Db context changes for auto insertion

This commit is contained in:
uppuv
2023-08-25 18:24:46 -04:00
parent 099055d088
commit 82f2ae265a
16 changed files with 83 additions and 54 deletions

View File

@ -8,5 +8,12 @@ namespace DamageAssesment.Api.Attachments.Db
{
}
public DbSet<Db.Attachment> Attachments { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<Attachment>()
.Property(item => item.Id)
.ValueGeneratedOnAdd();
}
}
}