DamageAssessment_Backend/DamageAssesmentApi/DamageAssesment.Api.Employees/Db/EmployeeDbContext.cs

22 lines
571 B
C#

using Microsoft.EntityFrameworkCore;
namespace DamageAssesment.Api.Employees.Db
{
public class EmployeeDbContext: DbContext
{
public DbSet<Db.Employee> Employees { get; set; }
public EmployeeDbContext(DbContextOptions options) : base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<Employee>()
.Property(item => item.Id)
.ValueGeneratedOnAdd();
}
}
}