39 lines
1.5 KiB
C#
39 lines
1.5 KiB
C#
using Microsoft.AspNetCore.Identity;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.Extensions.Configuration;
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace DamageAssesment.Api.DocuLinks.Db
|
|
{
|
|
public class DoculinkDbContext : DbContext
|
|
{
|
|
public DoculinkDbContext(DbContextOptions options) : base(options)
|
|
{
|
|
}
|
|
public DbSet<Db.Doculink> Documents { get; set; }
|
|
public DbSet<Db.LinkType> LinkTypes { get; set; }
|
|
public DbSet<Db.DoculinkTranslation> DocumentsTranslations { get; set; }
|
|
public DbSet<Db.LinksTranslation> LinksTranslations { get; set; }
|
|
public DbSet<Db.DoculinkAttachments> DoclinksAttachments { get; set; }
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
base.OnModelCreating(modelBuilder);
|
|
modelBuilder.Entity<Doculink>()
|
|
.Property(item => item.Id)
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<LinkType>()
|
|
.Property(item => item.Id)
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<DoculinkTranslation>()
|
|
.Property(item => item.Id)
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<LinksTranslation>()
|
|
.Property(item => item.Id)
|
|
.ValueGeneratedOnAdd();
|
|
modelBuilder.Entity<DoculinkAttachments>()
|
|
.Property(item => item.Id)
|
|
.ValueGeneratedOnAdd();
|
|
}
|
|
}
|
|
}
|