DamageAssessment_Backend/DamageAssesmentApi/DamageAssesment.Api.Answers/Db/AnswerDbContext.cs

23 lines
570 B
C#
Raw Normal View History

2023-08-15 22:52:30 -05:00
using Microsoft.EntityFrameworkCore;
namespace DamageAssesment.Api.Answers.Db
{
public class AnswerDbContext:DbContext
{
public AnswerDbContext(DbContextOptions options):base(options)
{
}
public DbSet<Db.Answer> Answers { get; set; }
2023-08-25 17:24:46 -05:00
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<Answer>()
.Property(item => item.Id)
.ValueGeneratedOnAdd();
}
2023-08-15 22:52:30 -05:00
}
}