DamageAssessment_Backend/DamageAssesmentApi/DamageAssesment.Api.Surveys/Db/SurveysDbContext.cs
2023-08-18 17:14:41 -04:00

21 lines
699 B
C#

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<Db.Survey> Surveys { get; set; }
}
}