TContext

    0

    0

    This code configures the instance of the ApplicationDbContext to use the local database named Test on the machine localdb.

    public class ApplicationDbContext : DbContext
    {
      private readonly string _connectionString;
    
      public ApplicationDbContext(string connectionString)
      {
        _connectionString = connectionString;
      }
    
      protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
      {
        optionsBuilder.UseSqlServer(_connectionString);
      }
    }
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.