2023-08-15 22:52:30 -05:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
|
|
|
|
namespace DamageAssesment.Api.Surveys.Db
|
|
|
|
|
{
|
2023-08-25 16:51:07 -05:00
|
|
|
|
public class SurveysDbContext : DbContext
|
2023-08-15 22:52:30 -05:00
|
|
|
|
{
|
2023-08-25 16:51:07 -05:00
|
|
|
|
public DbSet<Db.Survey> Surveys { get; set; }
|
|
|
|
|
public DbSet<Db.SurveyTranslation> SurveysTranslation { get; set; }
|
2023-08-15 22:52:30 -05:00
|
|
|
|
public SurveysDbContext(DbContextOptions options) : base(options)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
2023-08-25 16:51:07 -05:00
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
|
|
|
{
|
|
|
|
|
base.OnModelCreating(modelBuilder);
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity<Survey>()
|
|
|
|
|
.Property(item => item.Id)
|
|
|
|
|
.ValueGeneratedOnAdd();
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity<SurveyTranslation>()
|
|
|
|
|
.Property(item => item.Id)
|
|
|
|
|
.ValueGeneratedOnAdd();
|
|
|
|
|
}
|
2023-08-15 22:52:30 -05:00
|
|
|
|
}
|
|
|
|
|
}
|