DamageAssessment_Backend/DamageAssesmentApi/DamageAssesment.Api.Surveys/Db/SurveysDbContext.cs

27 lines
767 B
C#
Raw Normal View History

2023-08-15 22:52:30 -05:00
using Microsoft.EntityFrameworkCore;
namespace DamageAssesment.Api.Surveys.Db
{
public class SurveysDbContext : DbContext
2023-08-15 22:52:30 -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)
{
}
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
}
}