mirror of
https://gitlab.com/Hukuta47/cartrix.git
synced 2026-12-05 12:30:55 +00:00
d
This commit is contained in:
1 parent
568f360548
commit
c4182ec609
100 files changed
+2052
-3518
No files matched your search
@@ -1,4 +1,3 @@
|
||||
using Entities = CartriX.Api.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CartriX.Api.Classes
|
||||
@@ -9,8 +8,8 @@ namespace CartriX.Api.Classes
|
||||
|
||||
public DbSet<Entities.Printer> Printers { get; set; }
|
||||
public DbSet<Entities.PrinterModel> PrinterModels { get; set; }
|
||||
public DbSet<Entities.CartridgeArticle> cartridgeArticles { get; set; }
|
||||
public DbSet<Entities.ConnetctionType> connetctionTypes { get; set; }
|
||||
public DbSet<Entities.CartridgeArticle> СartridgeArticles { get; set; }
|
||||
public DbSet<Entities.ConnetctionType> СonnetctionTypes { get; set; }
|
||||
public DbSet<Entities.Location> Locations { get; set; }
|
||||
public DbSet<Entities.Cartridge> Cartridges { get; set; }
|
||||
public DbSet<Entities.CartridgeModel> CartridgeModels { get; set; }
|
||||
@@ -33,23 +32,22 @@ namespace CartriX.Api.Classes
|
||||
modelBuilder.Entity<Entities.CartridgeStatus>().HasData(
|
||||
new Entities.CartridgeStatus { id = 1, name = "Installed" },
|
||||
new Entities.CartridgeStatus { id = 2, name = "InStock" },
|
||||
new Entities.CartridgeStatus { id = 3, name = "WriteOff" },
|
||||
new Entities.CartridgeStatus { id = 4, name = "Refilling" },
|
||||
new Entities.CartridgeStatus { id = 5, name = "InlineRefilling" },
|
||||
new Entities.CartridgeStatus { id = 6, name = "UnderRepair" }
|
||||
new Entities.CartridgeStatus { id = 3, name = "Refilling" },
|
||||
new Entities.CartridgeStatus { id = 4, name = "InlineRefilling" },
|
||||
new Entities.CartridgeStatus { id = 5, name = "UnderRepair" }
|
||||
);
|
||||
modelBuilder.Entity<Entities.ConnetctionType>().HasData(
|
||||
new Entities.ConnetctionType { id = 1, name = "Network" },
|
||||
new Entities.ConnetctionType { id = 2, name = "USB" }
|
||||
);
|
||||
|
||||
modelBuilder.Entity<Entities.Printer>().Property(p => p.oidForQueryCountPrintedAllTime).HasDefaultValue("1.3.6.1.2.1.43.10.2.1.4.1.1");
|
||||
|
||||
|
||||
modelBuilder.Entity<Entities.Cartridge>().Property(p => p.statusId).HasDefaultValue("2");
|
||||
|
||||
modelBuilder.Entity<Entities.CartridgeArticle>()
|
||||
.HasMany(c => c.CartridgeModels)
|
||||
.HasMany(c => c.CartridgeModel)
|
||||
.WithMany(p => p.Articles)
|
||||
.UsingEntity(e => e.ToTable("PrintersModelsCartridgeArticles"));
|
||||
.UsingEntity(e => e.ToTable("printerModel_cartridgeArticles"));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user