Merge pull request 'Lab3Update magic' (#12) from Lab3Update into Lab3-Hard
Reviewed-on: #12
This commit is contained in:
commit
ecb8f9287a
@ -13,7 +13,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SewingDressesBusinessLogic"
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SewingDressesListImplement", "SewingDressesListImplement\SewingDressesListImplement.csproj", "{0F2DC551-6221-4471-BBAA-C5C65E45E66C}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SewingDressesListImplement", "SewingDressesListImplement\SewingDressesListImplement.csproj", "{0F2DC551-6221-4471-BBAA-C5C65E45E66C}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SewingDressesFileImplement", "SewingDressesFileImplement\SewingDressesFileImplement.csproj", "{340D02B6-5B03-47A2-8498-BB7DBBCB7F5B}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SewingDressesFileImplement", "SewingDressesFileImplement\SewingDressesFileImplement.csproj", "{340D02B6-5B03-47A2-8498-BB7DBBCB7F5B}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SewingDressesDatabaseImplement", "SewingDressesDatabaseImplement\SewingDressesDatabaseImplement.csproj", "{A3420FD5-1798-447D-957E-6455474228CC}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@ -45,6 +47,10 @@ Global
|
|||||||
{340D02B6-5B03-47A2-8498-BB7DBBCB7F5B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{340D02B6-5B03-47A2-8498-BB7DBBCB7F5B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{340D02B6-5B03-47A2-8498-BB7DBBCB7F5B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{340D02B6-5B03-47A2-8498-BB7DBBCB7F5B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{340D02B6-5B03-47A2-8498-BB7DBBCB7F5B}.Release|Any CPU.Build.0 = Release|Any CPU
|
{340D02B6-5B03-47A2-8498-BB7DBBCB7F5B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{A3420FD5-1798-447D-957E-6455474228CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{A3420FD5-1798-447D-957E-6455474228CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{A3420FD5-1798-447D-957E-6455474228CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{A3420FD5-1798-447D-957E-6455474228CC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
@ -0,0 +1,70 @@
|
|||||||
|
using SewingDressesContracts.BindingModels;
|
||||||
|
using SewingDressesContracts.SearchModels;
|
||||||
|
using SewingDressesContracts.StoragesContracts;
|
||||||
|
using SewingDressesContracts.ViewModels;
|
||||||
|
using SewingDressesDatabaseImplement.Models;
|
||||||
|
namespace SewingDressesDatabaseImplement.Implements
|
||||||
|
{
|
||||||
|
public class ComponentStorage : IComponentStorage
|
||||||
|
{
|
||||||
|
public List<ComponentViewModel> GetFullList()
|
||||||
|
{
|
||||||
|
using var context = new SewingDressesDatabase();
|
||||||
|
return context.Components.Select(x => x.GetViewModel).ToList();
|
||||||
|
}
|
||||||
|
public List<ComponentViewModel> GetFilteredList(ComponentSearchModel model)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(model.ComponentName))
|
||||||
|
{
|
||||||
|
return new();
|
||||||
|
}
|
||||||
|
using var context = new SewingDressesDatabase();
|
||||||
|
return context.Components.Where(x => x.ComponentName.Contains(model.ComponentName)).Select(x => x.GetViewModel).ToList();
|
||||||
|
}
|
||||||
|
public ComponentViewModel? GetElement(ComponentSearchModel model)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(model.ComponentName) && !model.Id.HasValue)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
using var context = new SewingDressesDatabase();
|
||||||
|
return context.Components.FirstOrDefault(x => (!string.IsNullOrEmpty(model.ComponentName) && x.ComponentName == model.ComponentName) || (model.Id.HasValue && x.Id == model.Id))?.GetViewModel;
|
||||||
|
}
|
||||||
|
public ComponentViewModel? Insert(ComponentBindingModel model)
|
||||||
|
{
|
||||||
|
var newComponent = Component.Create(model);
|
||||||
|
if (newComponent == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
using var context = new SewingDressesDatabase();
|
||||||
|
context.Components.Add(newComponent);
|
||||||
|
context.SaveChanges();
|
||||||
|
return newComponent.GetViewModel;
|
||||||
|
}
|
||||||
|
public ComponentViewModel? Update(ComponentBindingModel model)
|
||||||
|
{
|
||||||
|
using var context = new SewingDressesDatabase();
|
||||||
|
var component = context.Components.FirstOrDefault(x => x.Id == model.Id);
|
||||||
|
if (component == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
component.Update(model);
|
||||||
|
context.SaveChanges();
|
||||||
|
return component.GetViewModel;
|
||||||
|
}
|
||||||
|
public ComponentViewModel? Delete(ComponentBindingModel model)
|
||||||
|
{
|
||||||
|
using var context = new SewingDressesDatabase();
|
||||||
|
var element = context.Components.FirstOrDefault(rec => rec.Id == model.Id);
|
||||||
|
if (element == null )
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
context.Components.Remove(element);
|
||||||
|
context.SaveChanges();
|
||||||
|
return element.GetViewModel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,90 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using SewingDressesContracts.BindingModels;
|
||||||
|
using SewingDressesContracts.SearchModels;
|
||||||
|
using SewingDressesContracts.StoragesContracts;
|
||||||
|
using SewingDressesContracts.ViewModels;
|
||||||
|
using SewingDressesDatabaseImplement.Models;
|
||||||
|
|
||||||
|
namespace SewingDressesDatabaseImplement.Implements
|
||||||
|
{
|
||||||
|
public class DressStorage : IDressStorage
|
||||||
|
{
|
||||||
|
public List<DressViewModel> GetFullList()
|
||||||
|
{
|
||||||
|
using var context = new SewingDressesDatabase();
|
||||||
|
return context.Dresses.Include(x => x.Components).ThenInclude(x => x.Component).ToList().Select(x => x.GetViewModel).ToList();
|
||||||
|
}
|
||||||
|
public List<DressViewModel> GetFilteredList(DressSearchModel model)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(model.DressName))
|
||||||
|
{
|
||||||
|
return new();
|
||||||
|
}
|
||||||
|
using var context = new SewingDressesDatabase();
|
||||||
|
return context.Dresses.Include(x => x.Components).ThenInclude(x => x.Component).Where(x => x.DressName.Contains(model.DressName)).ToList().Select(x => x.GetViewModel).ToList();
|
||||||
|
|
||||||
|
}
|
||||||
|
public DressViewModel? GetElement(DressSearchModel model)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(model.DressName) &&
|
||||||
|
!model.Id.HasValue)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
using var context = new SewingDressesDatabase();
|
||||||
|
return context.Dresses.Include(x => x.Components).ThenInclude(x => x.Component)
|
||||||
|
.FirstOrDefault(x => (!string.IsNullOrEmpty(model.DressName) && x.DressName == model.DressName) || (model.Id.HasValue && x.Id == model.Id))?.GetViewModel;
|
||||||
|
}
|
||||||
|
public DressViewModel? Insert(DressBindingModel model)
|
||||||
|
{
|
||||||
|
using var context = new SewingDressesDatabase();
|
||||||
|
var newDress = Dress.Create(context, model);
|
||||||
|
if (newDress == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
context.Dresses.Add(newDress);
|
||||||
|
context.SaveChanges();
|
||||||
|
return newDress.GetViewModel;
|
||||||
|
}
|
||||||
|
public DressViewModel? Update(DressBindingModel model)
|
||||||
|
{
|
||||||
|
using var context = new SewingDressesDatabase();
|
||||||
|
using var transaction = context.Database.BeginTransaction();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var dress = context.Dresses.FirstOrDefault(rec =>
|
||||||
|
rec.Id == model.Id);
|
||||||
|
if (dress == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
dress.Update(model);
|
||||||
|
context.SaveChanges();
|
||||||
|
dress.UpdateComponents(context, model);
|
||||||
|
transaction.Commit();
|
||||||
|
return dress.GetViewModel;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
transaction.Rollback();
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public DressViewModel? Delete(DressBindingModel model)
|
||||||
|
{
|
||||||
|
using var context = new SewingDressesDatabase();
|
||||||
|
var element = context.Dresses
|
||||||
|
.Include(x => x.Components)
|
||||||
|
.FirstOrDefault(rec => rec.Id == model.Id);
|
||||||
|
if (element != null)
|
||||||
|
{
|
||||||
|
context.Dresses.Remove(element);
|
||||||
|
context.SaveChanges();
|
||||||
|
return element.GetViewModel;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,89 @@
|
|||||||
|
using SewingDressesContracts.BindingModels;
|
||||||
|
using SewingDressesContracts.SearchModels;
|
||||||
|
using SewingDressesContracts.StoragesContracts;
|
||||||
|
using SewingDressesContracts.ViewModels;
|
||||||
|
using SewingDressesDatabaseImplement.Models;
|
||||||
|
|
||||||
|
namespace SewingDressesDatabaseImplement.Implements
|
||||||
|
{
|
||||||
|
public class OrderStorage : IOrderStorage
|
||||||
|
{
|
||||||
|
public List<OrderViewModel?> GetFullList()
|
||||||
|
{
|
||||||
|
using var context = new SewingDressesDatabase();
|
||||||
|
return context.Orders.Select(x => AcessDressesStorage(x.GetViewModel, context)).ToList();
|
||||||
|
}
|
||||||
|
public List<OrderViewModel?> GetFilteredList(OrderSearchModel model)
|
||||||
|
{
|
||||||
|
if (!model.Id.HasValue)
|
||||||
|
{
|
||||||
|
return new();
|
||||||
|
}
|
||||||
|
using var context = new SewingDressesDatabase();
|
||||||
|
return context.Orders.Where(x => x.Id == model.Id).Select(x => AcessDressesStorage(x.GetViewModel, context)).ToList();
|
||||||
|
}
|
||||||
|
public OrderViewModel? GetElement(OrderSearchModel model)
|
||||||
|
{
|
||||||
|
if (!model.Id.HasValue)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
using var context = new SewingDressesDatabase();
|
||||||
|
return AcessDressesStorage(context.Orders.FirstOrDefault(x => x.Id == model.Id)?.GetViewModel, context);
|
||||||
|
}
|
||||||
|
public OrderViewModel? Insert(OrderBindingModel model)
|
||||||
|
{
|
||||||
|
var order = Order.Create(model);
|
||||||
|
if (order == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
using var context = new SewingDressesDatabase();
|
||||||
|
context.Orders.Add(order);
|
||||||
|
context.SaveChanges();
|
||||||
|
return AcessDressesStorage(order.GetViewModel, context);
|
||||||
|
|
||||||
|
}
|
||||||
|
public OrderViewModel? Update(OrderBindingModel model)
|
||||||
|
{
|
||||||
|
|
||||||
|
using var context = new SewingDressesDatabase();
|
||||||
|
var order = context.Orders.FirstOrDefault(x => x.Id == model.Id);
|
||||||
|
if (order == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
order.Update(model);
|
||||||
|
context.SaveChanges();
|
||||||
|
return AcessDressesStorage(order.GetViewModel, context);
|
||||||
|
|
||||||
|
}
|
||||||
|
public OrderViewModel? Delete(OrderBindingModel model)
|
||||||
|
{
|
||||||
|
using var context = new SewingDressesDatabase();
|
||||||
|
var element = context.Orders.FirstOrDefault(x => x.Id == model.Id);
|
||||||
|
if (element == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
context.Orders.Remove(element);
|
||||||
|
context.SaveChanges();
|
||||||
|
return AcessDressesStorage(element.GetViewModel, context);
|
||||||
|
}
|
||||||
|
public static OrderViewModel? AcessDressesStorage(OrderViewModel? model, SewingDressesDatabase context)
|
||||||
|
{
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
var dress = context.Dresses.FirstOrDefault(x => x.Id == model.DressId);
|
||||||
|
if (dress == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
model.DressName = dress.DressName;
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
169
SewingDresses/SewingDressesDatabaseImplement/Migrations/20240308104531_InitialCreate.Designer.cs
generated
Normal file
169
SewingDresses/SewingDressesDatabaseImplement/Migrations/20240308104531_InitialCreate.Designer.cs
generated
Normal file
@ -0,0 +1,169 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
using SewingDressesDatabaseImplement;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace SewingDressesDatabaseImplement1.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(SewingDressesDatabase))]
|
||||||
|
[Migration("20240308104531_InitialCreate")]
|
||||||
|
partial class InitialCreate
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.2")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("SewingDressesDatabaseImplement.Models.Component", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("ComponentName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<double>("Cost")
|
||||||
|
.HasColumnType("float");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Components");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SewingDressesDatabaseImplement.Models.Dress", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("DressName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<double>("Price")
|
||||||
|
.HasColumnType("float");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Dresses");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SewingDressesDatabaseImplement.Models.DressComponent", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("ComponentId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Count")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("DressId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ComponentId");
|
||||||
|
|
||||||
|
b.HasIndex("DressId");
|
||||||
|
|
||||||
|
b.ToTable("DressComponents");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SewingDressesDatabaseImplement.Models.Order", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Count")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DateCreate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DateImplement")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("DressId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Status")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<double>("Sum")
|
||||||
|
.HasColumnType("float");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DressId");
|
||||||
|
|
||||||
|
b.ToTable("Orders");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SewingDressesDatabaseImplement.Models.DressComponent", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("SewingDressesDatabaseImplement.Models.Component", "Component")
|
||||||
|
.WithMany("DressComponents")
|
||||||
|
.HasForeignKey("ComponentId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("SewingDressesDatabaseImplement.Models.Dress", "Dress")
|
||||||
|
.WithMany("Components")
|
||||||
|
.HasForeignKey("DressId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Component");
|
||||||
|
|
||||||
|
b.Navigation("Dress");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SewingDressesDatabaseImplement.Models.Order", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("SewingDressesDatabaseImplement.Models.Dress", null)
|
||||||
|
.WithMany("Orders")
|
||||||
|
.HasForeignKey("DressId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SewingDressesDatabaseImplement.Models.Component", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("DressComponents");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SewingDressesDatabaseImplement.Models.Dress", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Components");
|
||||||
|
|
||||||
|
b.Navigation("Orders");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,125 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace SewingDressesDatabaseImplement1.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class InitialCreate : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Components",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
ComponentName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
Cost = table.Column<double>(type: "float", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Components", x => x.Id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Dresses",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
DressName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
Price = table.Column<double>(type: "float", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Dresses", x => x.Id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "DressComponents",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
DressId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
ComponentId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
Count = table.Column<int>(type: "int", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_DressComponents", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_DressComponents_Components_ComponentId",
|
||||||
|
column: x => x.ComponentId,
|
||||||
|
principalTable: "Components",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_DressComponents_Dresses_DressId",
|
||||||
|
column: x => x.DressId,
|
||||||
|
principalTable: "Dresses",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Orders",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
DressId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
Count = table.Column<int>(type: "int", nullable: false),
|
||||||
|
Sum = table.Column<double>(type: "float", nullable: false),
|
||||||
|
Status = table.Column<int>(type: "int", nullable: false),
|
||||||
|
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
|
DateImplement = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Orders", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Orders_Dresses_DressId",
|
||||||
|
column: x => x.DressId,
|
||||||
|
principalTable: "Dresses",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_DressComponents_ComponentId",
|
||||||
|
table: "DressComponents",
|
||||||
|
column: "ComponentId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_DressComponents_DressId",
|
||||||
|
table: "DressComponents",
|
||||||
|
column: "DressId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Orders_DressId",
|
||||||
|
table: "Orders",
|
||||||
|
column: "DressId");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "DressComponents");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Orders");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Components");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Dresses");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,166 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
using SewingDressesDatabaseImplement;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace SewingDressesDatabaseImplement1.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(SewingDressesDatabase))]
|
||||||
|
partial class SewingDressesDatabaseModelSnapshot : ModelSnapshot
|
||||||
|
{
|
||||||
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.2")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("SewingDressesDatabaseImplement.Models.Component", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("ComponentName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<double>("Cost")
|
||||||
|
.HasColumnType("float");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Components");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SewingDressesDatabaseImplement.Models.Dress", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("DressName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<double>("Price")
|
||||||
|
.HasColumnType("float");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Dresses");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SewingDressesDatabaseImplement.Models.DressComponent", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("ComponentId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Count")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("DressId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ComponentId");
|
||||||
|
|
||||||
|
b.HasIndex("DressId");
|
||||||
|
|
||||||
|
b.ToTable("DressComponents");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SewingDressesDatabaseImplement.Models.Order", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Count")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DateCreate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DateImplement")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("DressId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Status")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<double>("Sum")
|
||||||
|
.HasColumnType("float");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DressId");
|
||||||
|
|
||||||
|
b.ToTable("Orders");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SewingDressesDatabaseImplement.Models.DressComponent", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("SewingDressesDatabaseImplement.Models.Component", "Component")
|
||||||
|
.WithMany("DressComponents")
|
||||||
|
.HasForeignKey("ComponentId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("SewingDressesDatabaseImplement.Models.Dress", "Dress")
|
||||||
|
.WithMany("Components")
|
||||||
|
.HasForeignKey("DressId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Component");
|
||||||
|
|
||||||
|
b.Navigation("Dress");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SewingDressesDatabaseImplement.Models.Order", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("SewingDressesDatabaseImplement.Models.Dress", null)
|
||||||
|
.WithMany("Orders")
|
||||||
|
.HasForeignKey("DressId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SewingDressesDatabaseImplement.Models.Component", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("DressComponents");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SewingDressesDatabaseImplement.Models.Dress", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Components");
|
||||||
|
|
||||||
|
b.Navigation("Orders");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
using SewingDressesContracts.BindingModels;
|
||||||
|
using SewingDressesContracts.ViewModels;
|
||||||
|
using SewingDressesDataModels.Models;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
namespace SewingDressesDatabaseImplement.Models
|
||||||
|
{
|
||||||
|
public class Component : IComponentModel
|
||||||
|
{
|
||||||
|
public int Id { get; private set; }
|
||||||
|
[Required]
|
||||||
|
public string ComponentName { get; private set; } = string.Empty;
|
||||||
|
[Required]
|
||||||
|
public double Cost { get; set; }
|
||||||
|
[ForeignKey("ComponentId")]
|
||||||
|
public virtual List<DressComponent> DressComponents { get; set; } = new();
|
||||||
|
public static Component? Create (ComponentBindingModel model)
|
||||||
|
{
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new Component
|
||||||
|
{
|
||||||
|
Id = model.Id,
|
||||||
|
ComponentName = model.ComponentName,
|
||||||
|
Cost = model.Cost
|
||||||
|
};
|
||||||
|
}
|
||||||
|
public static Component Create(ComponentViewModel model)
|
||||||
|
{
|
||||||
|
return new Component
|
||||||
|
{
|
||||||
|
Id = model.Id,
|
||||||
|
ComponentName = model.ComponentName,
|
||||||
|
Cost = model.Cost
|
||||||
|
};
|
||||||
|
}
|
||||||
|
public void Update(ComponentBindingModel model)
|
||||||
|
{
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ComponentName = model.ComponentName;
|
||||||
|
Cost = model.Cost;
|
||||||
|
}
|
||||||
|
public ComponentViewModel GetViewModel => new()
|
||||||
|
{
|
||||||
|
Id = Id,
|
||||||
|
ComponentName = ComponentName,
|
||||||
|
Cost = Cost
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
89
SewingDresses/SewingDressesDatabaseImplement/Models/Dress.cs
Normal file
89
SewingDresses/SewingDressesDatabaseImplement/Models/Dress.cs
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
using SewingDressesContracts.BindingModels;
|
||||||
|
using SewingDressesContracts.ViewModels;
|
||||||
|
using SewingDressesDataModels.Models;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
|
||||||
|
namespace SewingDressesDatabaseImplement.Models
|
||||||
|
{
|
||||||
|
public class Dress : IDressModel
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
[Required]
|
||||||
|
public string DressName { get; set; } = string.Empty;
|
||||||
|
[Required]
|
||||||
|
public double Price { get; set; }
|
||||||
|
private Dictionary<int, (IComponentModel, int)>? _dressComponents = null;
|
||||||
|
[NotMapped]
|
||||||
|
public Dictionary<int, (IComponentModel, int)> DressComponents
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_dressComponents == null)
|
||||||
|
{
|
||||||
|
_dressComponents = Components.ToDictionary(recDC => recDC.ComponentId, recDC => (recDC.Component as IComponentModel, recDC.Count));
|
||||||
|
}
|
||||||
|
return _dressComponents;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
[ForeignKey("DressId")]
|
||||||
|
public virtual List<DressComponent> Components { get; set; } = new();
|
||||||
|
[ForeignKey("DressId")]
|
||||||
|
public virtual List<Order> Orders { get; set; } = new();
|
||||||
|
public static Dress Create(SewingDressesDatabase context, DressBindingModel model)
|
||||||
|
{
|
||||||
|
return new Dress()
|
||||||
|
{
|
||||||
|
Id = model.Id,
|
||||||
|
DressName = model.DressName,
|
||||||
|
Price = model.Price,
|
||||||
|
Components = model.DressComponents.Select(x => new DressComponent
|
||||||
|
{
|
||||||
|
Component = context.Components.First(y => y.Id == x.Key),
|
||||||
|
Count = x.Value.Item2
|
||||||
|
}).ToList()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
public void Update(DressBindingModel model)
|
||||||
|
{
|
||||||
|
DressName = model.DressName;
|
||||||
|
Price = model.Price;
|
||||||
|
}
|
||||||
|
public DressViewModel GetViewModel => new()
|
||||||
|
{
|
||||||
|
Id = Id,
|
||||||
|
DressName = DressName,
|
||||||
|
Price = Price,
|
||||||
|
DressComponents = DressComponents
|
||||||
|
};
|
||||||
|
public void UpdateComponents(SewingDressesDatabase context, DressBindingModel model)
|
||||||
|
{
|
||||||
|
var dressComponents = context.DressComponents.Where(rec => rec.DressId == model.Id).ToList();
|
||||||
|
if (dressComponents != null && dressComponents.Count > 0)
|
||||||
|
{
|
||||||
|
context.DressComponents.RemoveRange(dressComponents.Where(rec => !model.DressComponents.ContainsKey(rec.ComponentId)));
|
||||||
|
context.SaveChanges();
|
||||||
|
foreach (var updateComponent in dressComponents)
|
||||||
|
{
|
||||||
|
updateComponent.Count = model.DressComponents[updateComponent.ComponentId].Item2;
|
||||||
|
model.DressComponents.Remove(updateComponent.ComponentId);
|
||||||
|
}
|
||||||
|
context.SaveChanges();
|
||||||
|
}
|
||||||
|
var dress = context.Dresses.First(x => x.Id == Id);
|
||||||
|
foreach (var pc in model.DressComponents)
|
||||||
|
{
|
||||||
|
context.DressComponents.Add(new DressComponent
|
||||||
|
{
|
||||||
|
Dress = dress,
|
||||||
|
Component = context.Components.First(x => x.Id == pc.Key),
|
||||||
|
Count = pc.Value.Item2
|
||||||
|
});
|
||||||
|
context.SaveChanges();
|
||||||
|
}
|
||||||
|
_dressComponents = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace SewingDressesDatabaseImplement.Models
|
||||||
|
{
|
||||||
|
public class DressComponent
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
[Required]
|
||||||
|
public int DressId { get; set; }
|
||||||
|
[Required]
|
||||||
|
public int ComponentId { get; set; }
|
||||||
|
[Required]
|
||||||
|
public int Count { get; set; }
|
||||||
|
public virtual Component Component { get; set; } = new();
|
||||||
|
public virtual Dress Dress { get; set; } = new();
|
||||||
|
}
|
||||||
|
}
|
61
SewingDresses/SewingDressesDatabaseImplement/Models/Order.cs
Normal file
61
SewingDresses/SewingDressesDatabaseImplement/Models/Order.cs
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
using SewingDressesContracts.BindingModels;
|
||||||
|
using SewingDressesContracts.ViewModels;
|
||||||
|
using SewingDressesDataModels.Enums;
|
||||||
|
using SewingDressesDataModels.Models;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
namespace SewingDressesDatabaseImplement.Models
|
||||||
|
{
|
||||||
|
public class Order : IOrderModel
|
||||||
|
{
|
||||||
|
public int Id { get; private set; }
|
||||||
|
[Required]
|
||||||
|
public int DressId { get; private set; }
|
||||||
|
[Required]
|
||||||
|
public int Count { get; private set; }
|
||||||
|
[Required]
|
||||||
|
public double Sum { get; private set; }
|
||||||
|
[Required]
|
||||||
|
public OrderStatus Status { get; private set; }
|
||||||
|
[Required]
|
||||||
|
public DateTime DateCreate { get; private set; } = DateTime.Now;
|
||||||
|
public DateTime? DateImplement { get; private set; }
|
||||||
|
|
||||||
|
public static Order? Create(OrderBindingModel model)
|
||||||
|
{
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new Order()
|
||||||
|
{
|
||||||
|
Id = model.Id,
|
||||||
|
DressId = model.DressId,
|
||||||
|
Count = model.Count,
|
||||||
|
Sum = model.Sum,
|
||||||
|
Status = model.Status,
|
||||||
|
DateCreate = model.DateCreate
|
||||||
|
};
|
||||||
|
}
|
||||||
|
public void Update(OrderBindingModel model)
|
||||||
|
{
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Status = model.Status;
|
||||||
|
DateImplement = model.DateImplement;
|
||||||
|
}
|
||||||
|
public OrderViewModel GetViewModel => new()
|
||||||
|
{
|
||||||
|
Id = Id,
|
||||||
|
DressId = DressId,
|
||||||
|
Count = Count,
|
||||||
|
Sum = Sum,
|
||||||
|
Status = Status,
|
||||||
|
DateCreate = DateCreate,
|
||||||
|
DateImplement = DateImplement
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
using SewingDressesDatabaseImplement.Models;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
namespace SewingDressesDatabaseImplement
|
||||||
|
{
|
||||||
|
public class SewingDressesDatabase : DbContext
|
||||||
|
{
|
||||||
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||||
|
{
|
||||||
|
if (optionsBuilder.IsConfigured == false)
|
||||||
|
{
|
||||||
|
optionsBuilder.UseSqlServer(@"Data Source=.\SQLEXPRESS;Initial Catalog=SewingDressesDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
||||||
|
}
|
||||||
|
base.OnConfiguring(optionsBuilder);
|
||||||
|
}
|
||||||
|
public virtual DbSet<Component> Components { get; set; }
|
||||||
|
public virtual DbSet<Dress> Dresses { get; set; }
|
||||||
|
public virtual DbSet<DressComponent> DressComponents { get; set; }
|
||||||
|
public virtual DbSet<Order> Orders { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.16" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.16" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.16">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\SewingDressesContracts\SewingDressesContracts.csproj" />
|
||||||
|
<ProjectReference Include="..\SewingDressesDataModels\SewingDressesDataModels.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
@ -1,7 +1,7 @@
|
|||||||
using SewingDressesBusinessLogic.BusinessLogic;
|
using SewingDressesBusinessLogic.BusinessLogic;
|
||||||
using SewingDressesContracts.BusinessLogicsContracts;
|
using SewingDressesContracts.BusinessLogicsContracts;
|
||||||
using SewingDressesContracts.StoragesContracts;
|
using SewingDressesContracts.StoragesContracts;
|
||||||
using SewingDressesFileImplement.Implements;
|
using SewingDressesDatabaseImplement.Implements;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using NLog.Extensions.Logging;
|
using NLog.Extensions.Logging;
|
||||||
|
@ -8,9 +8,17 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.16">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\SewingDressesBusinessLogic\SewingDressesBusinessLogic.csproj" />
|
<ProjectReference Include="..\SewingDressesBusinessLogic\SewingDressesBusinessLogic.csproj" />
|
||||||
<ProjectReference Include="..\SewingDressesContracts\SewingDressesContracts.csproj" />
|
<ProjectReference Include="..\SewingDressesContracts\SewingDressesContracts.csproj" />
|
||||||
|
<ProjectReference Include="..\SewingDressesDatabaseImplement\SewingDressesDatabaseImplement.csproj" />
|
||||||
<ProjectReference Include="..\SewingDressesFileImplement\SewingDressesFileImplement.csproj" />
|
<ProjectReference Include="..\SewingDressesFileImplement\SewingDressesFileImplement.csproj" />
|
||||||
<ProjectReference Include="..\SewingDressesListImplement\SewingDressesListImplement.csproj" />
|
<ProjectReference Include="..\SewingDressesListImplement\SewingDressesListImplement.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user