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

22 lines
571 B
C#
Raw Normal View History

2023-08-15 22:52:30 -05:00
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();
}
2023-08-15 22:52:30 -05:00
}
}