mirror of
https://gitlab.com/Hukuta47/cartrix.git
synced 2026-12-05 04:20:55 +00:00
21 lines
626 B
C#
21 lines
626 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using CartriX.Shared.Models;
|
|
|
|
namespace CartriX.Shared.Classes
|
|
{
|
|
public class AppDbContext : DbContext
|
|
{
|
|
public AppDbContext(DbContextOptions options) : base(options) { }
|
|
|
|
public DbSet<Printer> Printers { get; set; }
|
|
public DbSet<PrinterModel> PrinterModels { get; set; }
|
|
public DbSet<Location> Locations { get; set; }
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
modelBuilder.Entity<Location>().HasIndex(l => l.name).IsUnique();
|
|
|
|
base.OnModelCreating(modelBuilder);
|
|
}
|
|
}
|
|
} |