using Microsoft.EntityFrameworkCore; namespace DamageAssesment.Api.Surveys.Db { public class SurveysDbContext:DbContext { private IConfiguration _Configuration { get; set; } public SurveysDbContext(DbContextOptions options, IConfiguration configuration) : base(options) { _Configuration = configuration; } protected override void OnConfiguring(DbContextOptionsBuilder options) { // connect to sql server with connection string from app settings options.UseSqlServer(_Configuration.GetConnectionString("SurveyConnection")); } public DbSet Surveys { get; set; } } }