mirror of
https://gitlab.com/Hukuta47/cartrix.git
synced 2026-12-06 13:00:55 +00:00
Был сделан запрос POST для создание записи о принтере
This commit is contained in:
1 parent
7a0e7e0801
commit
02160f451f
43 files changed
+1044
-634
No files matched your search
@@ -0,0 +1,21 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user