27 lines
767 B
C#
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();
|
|
}
|
|
}
|
|
}
|