21 lines
699 B
C#
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; }
|
|
|
|
}
|
|
}
|