DamageAssessment_Backend/DamageAssesmentApi/DamageAssesment.Api.Surveys/Db/SurveysDbContext.cs
2023-08-25 17:51:07 -04:00

27 lines
767 B
C#

using Microsoft.EntityFrameworkCore;
namespace DamageAssesment.Api.Surveys.Db
{
public class SurveysDbContext : DbContext
{
public DbSet<Db.Survey> Surveys { get; set; }
public DbSet<Db.SurveyTranslation> SurveysTranslation { get; set; }
public SurveysDbContext(DbContextOptions options) : base(options)
{
}
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();
}
}
}