using System; using System.Collections.Generic; using Microsoft.EntityFrameworkCore; namespace ShoeShopMvc.Models; public partial class ShoeShopContext : DbContext { public ShoeShopContext() { } public ShoeShopContext(DbContextOptions options) : base(options) { } public virtual DbSet Categories { get; set; } public virtual DbSet Edizms { get; set; } public virtual DbSet Manufactures { get; set; } public virtual DbSet Orders { get; set; } public virtual DbSet OrderProducts { get; set; } public virtual DbSet PickPoints { get; set; } public virtual DbSet Products { get; set; } public virtual DbSet Roles { get; set; } public virtual DbSet Suppliers { get; set; } public virtual DbSet Users { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) #warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263. => optionsBuilder.UseSqlServer("Server=DESKTOP-7S4CGG7\\SQLEXPRESS;Database=826;Trusted_Connection=True;TrustServerCertificate=True;"); protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity(entity => { entity.ToTable("Category"); entity.Property(e => e.CategoryId) .HasMaxLength(50) .HasColumnName("category_id"); entity.Property(e => e.CategoryName) .HasMaxLength(50) .HasColumnName("category_name"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.IdEdIzm); entity.ToTable("edizm"); entity.Property(e => e.IdEdIzm) .HasMaxLength(50) .HasColumnName("id_ed_izm"); entity.Property(e => e.EdIzm1) .HasMaxLength(50) .HasColumnName("ed_izm"); }); modelBuilder.Entity(entity => { entity.ToTable("Manufacture"); entity.Property(e => e.ManufactureId) .HasMaxLength(50) .HasColumnName("manufacture_id"); entity.Property(e => e.ManufactureName) .HasMaxLength(50) .HasColumnName("manufacture_name"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.OrdersId); entity.Property(e => e.OrdersId) .HasMaxLength(50) .HasColumnName("orders_id"); entity.Property(e => e.ClientId) .HasMaxLength(50) .HasColumnName("client_id"); entity.Property(e => e.Cod).HasColumnName("cod"); entity.Property(e => e.DeliveryDate).HasColumnName("delivery_date"); entity.Property(e => e.OrdersDate) .HasMaxLength(50) .HasColumnName("orders_date"); entity.Property(e => e.AddressPickpoints) .HasMaxLength(50) .HasColumnName("PickPoints_id"); entity.Property(e => e.StatusId) .HasMaxLength(50) .HasColumnName("status_id"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.OrderProductsId); entity.ToTable("OrderProduct"); entity.Property(e => e.OrderProductsId) .HasMaxLength(50) .HasColumnName("OrderProducts_id"); entity.Property(e => e.Article) .HasMaxLength(50) .HasColumnName("article"); entity.Property(e => e.Colvo) .HasMaxLength(50) .HasColumnName("colvo"); entity.Property(e => e.OrdersId) .HasMaxLength(50) .HasColumnName("orders_id"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.PickPointsId); entity.Property(e => e.PickPointsId) .HasMaxLength(50) .HasColumnName("PickPoints_id"); entity.Property(e => e.AddressPickpoints) .HasMaxLength(50) .HasColumnName("Address_pickpoints"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.Article); entity.ToTable("Product"); entity.Property(e => e.Article) .HasMaxLength(50) .HasColumnName("article"); entity.Property(e => e.CategoryId) .HasMaxLength(50) .HasColumnName("category_id"); entity.Property(e => e.Colvo) .HasMaxLength(50) .HasColumnName("colvo"); entity.Property(e => e.EdIzm) .HasMaxLength(50) .HasColumnName("ed_izm"); entity.Property(e => e.Image) .HasMaxLength(50) .HasColumnName("image"); entity.Property(e => e.ManufactureId) .HasMaxLength(50) .HasColumnName("manufacture_id"); entity.Property(e => e.OpisanieProduct) .HasMaxLength(100) .HasColumnName("opisanie_product"); entity.Property(e => e.Price).HasColumnName("price"); entity.Property(e => e.ProductName) .HasMaxLength(50) .HasColumnName("product_name"); entity.Property(e => e.Skidka).HasColumnName("skidka"); entity.Property(e => e.SupplierId) .HasMaxLength(50) .HasColumnName("supplier_id"); }); modelBuilder.Entity(entity => { entity.Property(e => e.RoleId) .HasMaxLength(50) .HasColumnName("role_id"); entity.Property(e => e.RoleName) .HasMaxLength(50) .HasColumnName("role_name"); }); modelBuilder.Entity(entity => { entity.ToTable("suppliers"); entity.Property(e => e.SupplierId) .HasMaxLength(50) .HasColumnName("supplier_id"); entity.Property(e => e.SupplierName) .HasMaxLength(50) .HasColumnName("supplier_name"); }); modelBuilder.Entity(entity => { entity.Property(e => e.UserId) .HasMaxLength(50) .HasColumnName("user_id"); entity.Property(e => e.Fio) .HasMaxLength(50) .HasColumnName("FIO"); entity.Property(e => e.Login).HasMaxLength(50); entity.Property(e => e.Password).HasMaxLength(50); entity.Property(e => e.RoleId) .HasMaxLength(50) .HasColumnName("role_id"); }); OnModelCreatingPartial(modelBuilder); } partial void OnModelCreatingPartial(ModelBuilder modelBuilder); }