From 16837f9d4dacca3d23565b7395c7ca44baa84447 Mon Sep 17 00:00:00 2001 From: Oleg Shabunov Date: Thu, 2 May 2024 00:10:15 +0400 Subject: [PATCH] Report logic --- .../BusinessLogics/AssemblyLogic.cs | 2 +- .../BusinessLogics/ProductLogic.cs | 2 +- .../BusinessLogics/ReportGuarantorLogic.cs | 44 +++++++ .../BindingModels/AssemblyBindingModel.cs | 2 + .../IReportGuarantorLogic.cs | 23 ++++ .../StorageContracts/IComponentStorage.cs | 4 + .../ReportComponentByDateViewModel.cs | 25 ++++ .../ReportComponentWithShipmentViewModel.cs | 13 ++ ComputerShopDataModels/Enums/UserRole.cs | 8 +- .../ComputerShopDatabase.cs | 5 + .../Implements/AssemblyStorage.cs | 10 +- .../Implements/ComponentStorage.cs | 52 ++++++++ .../Implements/ProductStorage.cs | 10 +- .../Controllers/AssemblyController.cs | 114 ++++++++++++++++++ .../Controllers/ComponentController.cs | 98 +++++++++++++++ .../Controllers/ProductController.cs | 98 +++++++++++++++ ComputerShopRestApi/Program.cs | 9 +- 17 files changed, 499 insertions(+), 20 deletions(-) create mode 100644 ComputerShopBusinessLogic/BusinessLogics/ReportGuarantorLogic.cs create mode 100644 ComputerShopContracts/BusinessLogicContracts/IReportGuarantorLogic.cs create mode 100644 ComputerShopContracts/ViewModels/ReportComponentByDateViewModel.cs create mode 100644 ComputerShopContracts/ViewModels/ReportComponentWithShipmentViewModel.cs create mode 100644 ComputerShopRestApi/Controllers/AssemblyController.cs create mode 100644 ComputerShopRestApi/Controllers/ComponentController.cs create mode 100644 ComputerShopRestApi/Controllers/ProductController.cs diff --git a/ComputerShopBusinessLogic/BusinessLogics/AssemblyLogic.cs b/ComputerShopBusinessLogic/BusinessLogics/AssemblyLogic.cs index 43a1e7a..5d36982 100644 --- a/ComputerShopBusinessLogic/BusinessLogics/AssemblyLogic.cs +++ b/ComputerShopBusinessLogic/BusinessLogics/AssemblyLogic.cs @@ -102,7 +102,7 @@ namespace ComputerShopBusinessLogic.BusinessLogics if (string.IsNullOrEmpty(Model.Category)) throw new ArgumentException($"У сборки отсутствует категория"); - if (Model.Price <= 0) + if (Model.Price < 0) throw new ArgumentException("Цена сборки должна быть больше 0", nameof(Model.Price)); var Element = _assemblyStorage.GetElement(new AssemblySearchModel diff --git a/ComputerShopBusinessLogic/BusinessLogics/ProductLogic.cs b/ComputerShopBusinessLogic/BusinessLogics/ProductLogic.cs index deb1a82..19db180 100644 --- a/ComputerShopBusinessLogic/BusinessLogics/ProductLogic.cs +++ b/ComputerShopBusinessLogic/BusinessLogics/ProductLogic.cs @@ -110,7 +110,7 @@ namespace ComputerShopBusinessLogic.BusinessLogics if (string.IsNullOrEmpty(Model.ProductName)) throw new ArgumentException($"У товара отсутствует название"); - if (Model.Price <= 0) + if (Model.Price < 0) throw new ArgumentException("Цена товара должна быть больше 0", nameof(Model.Price)); if (Model.Warranty <= 0) diff --git a/ComputerShopBusinessLogic/BusinessLogics/ReportGuarantorLogic.cs b/ComputerShopBusinessLogic/BusinessLogics/ReportGuarantorLogic.cs new file mode 100644 index 0000000..b8d9f81 --- /dev/null +++ b/ComputerShopBusinessLogic/BusinessLogics/ReportGuarantorLogic.cs @@ -0,0 +1,44 @@ +using ComputerShopContracts.BindingModels; +using ComputerShopContracts.BusinessLogicContracts; +using ComputerShopContracts.SearchModels; +using ComputerShopContracts.StorageContracts; +using ComputerShopContracts.ViewModels; + +namespace ComputerShopBusinessLogic.BusinessLogics +{ + public class ReportGuarantorLogic : IReportGuarantorLogic + { + private readonly IComponentStorage _componentStorage; + + public ReportGuarantorLogic(IComponentStorage ComponentStorage) + { + _componentStorage = ComponentStorage; + } + + /// + /// Получение отчёта для Word или Excel + /// + public List GetReportComponentsWithShipments(List SelectedComponents) + { + return _componentStorage.GetComponentsWithShipments(SelectedComponents); + } + + /// + /// Получение отчёта для отправки на почту + /// + public List GetReportComponentsByRequestDate(UserSearchModel CurrentUser, ReportBindingModel Report) + { + return _componentStorage.GetComponentsByShipmentDate(Report, CurrentUser); + } + + public void SaveReportToWordFile(ReportBindingModel Model) + { + throw new NotImplementedException(); + } + + public void SaveReportToExcelFile(ReportBindingModel Model) + { + throw new NotImplementedException(); + } + } +} diff --git a/ComputerShopContracts/BindingModels/AssemblyBindingModel.cs b/ComputerShopContracts/BindingModels/AssemblyBindingModel.cs index 6ca738d..5c67fb7 100644 --- a/ComputerShopContracts/BindingModels/AssemblyBindingModel.cs +++ b/ComputerShopContracts/BindingModels/AssemblyBindingModel.cs @@ -15,5 +15,7 @@ namespace ComputerShopContracts.BindingModels public string Category { get; set; } = string.Empty; public Dictionary AssemblyComponents { get; set; } = new(); + + public Dictionary Test { get; set; } = new(); } } diff --git a/ComputerShopContracts/BusinessLogicContracts/IReportGuarantorLogic.cs b/ComputerShopContracts/BusinessLogicContracts/IReportGuarantorLogic.cs new file mode 100644 index 0000000..e68c6ab --- /dev/null +++ b/ComputerShopContracts/BusinessLogicContracts/IReportGuarantorLogic.cs @@ -0,0 +1,23 @@ +using ComputerShopContracts.BindingModels; +using ComputerShopContracts.SearchModels; +using ComputerShopContracts.ViewModels; + +namespace ComputerShopContracts.BusinessLogicContracts +{ + public interface IReportGuarantorLogic + { + /// + /// Получение отчёта для Word или Excel + /// + List GetReportComponentsWithShipments(List SelectedComponents); + + /// + /// Получение отчёта для отправки на почту + /// + List GetReportComponentsByRequestDate(UserSearchModel CurrentUser, ReportBindingModel Report); + + void SaveReportToWordFile(ReportBindingModel Model); + + void SaveReportToExcelFile(ReportBindingModel Model); + } +} diff --git a/ComputerShopContracts/StorageContracts/IComponentStorage.cs b/ComputerShopContracts/StorageContracts/IComponentStorage.cs index e0b7ed6..89dc469 100644 --- a/ComputerShopContracts/StorageContracts/IComponentStorage.cs +++ b/ComputerShopContracts/StorageContracts/IComponentStorage.cs @@ -17,5 +17,9 @@ namespace ComputerShopContracts.StorageContracts ComponentViewModel? Update(ComponentBindingModel Model); ComponentViewModel? Delete(ComponentBindingModel Model); + + List GetComponentsWithShipments(List Models); + + List GetComponentsByShipmentDate(ReportBindingModel ReportModel, UserSearchModel UserModel); } } diff --git a/ComputerShopContracts/ViewModels/ReportComponentByDateViewModel.cs b/ComputerShopContracts/ViewModels/ReportComponentByDateViewModel.cs new file mode 100644 index 0000000..588341e --- /dev/null +++ b/ComputerShopContracts/ViewModels/ReportComponentByDateViewModel.cs @@ -0,0 +1,25 @@ +namespace ComputerShopContracts.ViewModels +{ + public class ReportComponentByDateViewModel + { + public int ComponentId { get; set; } + + public string ComponentName { get; set; } = string.Empty; + + public double ComponentCost { get; set; } + + public int AssemblyId { get; set; } + + public string AssemblyName { get; set; } = string.Empty; + + public double AssemblyPrice { get; set; } + + public string AssemblyCategory { get; set; } = string.Empty; + + public int RequestId { get; set; } + + public DateTime DateRequest { get; set; } + + public string ClientFIO { get; set; } = string.Empty; + } +} diff --git a/ComputerShopContracts/ViewModels/ReportComponentWithShipmentViewModel.cs b/ComputerShopContracts/ViewModels/ReportComponentWithShipmentViewModel.cs new file mode 100644 index 0000000..6ff7178 --- /dev/null +++ b/ComputerShopContracts/ViewModels/ReportComponentWithShipmentViewModel.cs @@ -0,0 +1,13 @@ +namespace ComputerShopContracts.ViewModels +{ + public class ReportComponentWithShipmentViewModel + { + public int ComponentId { get; set; } + + public string ComponentName { get; set; } = string.Empty; + + public double ComponentCost { get; set; } + + public List<(int Count, string ProductName, double ProductPrice, string ProviderName, DateTime ShipmentDate)> Shipments { get; set; } = new(); + } +} diff --git a/ComputerShopDataModels/Enums/UserRole.cs b/ComputerShopDataModels/Enums/UserRole.cs index ae4de72..159d8e6 100644 --- a/ComputerShopDataModels/Enums/UserRole.cs +++ b/ComputerShopDataModels/Enums/UserRole.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ComputerShopDataModels.Enums +namespace ComputerShopDataModels.Enums { public enum UserRole { diff --git a/ComputerShopDatabaseImplement/ComputerShopDatabase.cs b/ComputerShopDatabaseImplement/ComputerShopDatabase.cs index c02c088..d0e9022 100644 --- a/ComputerShopDatabaseImplement/ComputerShopDatabase.cs +++ b/ComputerShopDatabaseImplement/ComputerShopDatabase.cs @@ -17,6 +17,7 @@ namespace ComputerShopDatabaseImplement AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true); } + public virtual DbSet Users { get; set; } public virtual DbSet Components { get; set; } @@ -31,9 +32,13 @@ namespace ComputerShopDatabaseImplement public virtual DbSet Orders { get; set; } + public virtual DbSet Requests { get; set; } + public virtual DbSet Shipments { get; set; } + public virtual DbSet ShipmentOrders { get; set; } + public virtual DbSet RequestOrders { get; set; } } } diff --git a/ComputerShopDatabaseImplement/Implements/AssemblyStorage.cs b/ComputerShopDatabaseImplement/Implements/AssemblyStorage.cs index 4fd4cde..cb02afb 100644 --- a/ComputerShopDatabaseImplement/Implements/AssemblyStorage.cs +++ b/ComputerShopDatabaseImplement/Implements/AssemblyStorage.cs @@ -15,7 +15,7 @@ namespace ComputerShopDatabaseImplement.Implements return Context.Assemblies .Include(x => x.Components) - .ThenInclude(x => x.Assembly) + .ThenInclude(x => x.Component) .Select(x => x.ViewModel) .ToList(); } @@ -29,7 +29,7 @@ namespace ComputerShopDatabaseImplement.Implements { return Context.Assemblies .Include(x => x.Components) - .ThenInclude(x => x.Assembly) + .ThenInclude(x => x.Component) .Where(x => x.UserId == Model.UserId && x.Category == Model.Category) .Select(x => x.ViewModel) .ToList(); @@ -37,7 +37,7 @@ namespace ComputerShopDatabaseImplement.Implements return Context.Assemblies .Include(x => x.Components) - .ThenInclude(x => x.Assembly) + .ThenInclude(x => x.Component) .Where(x => x.UserId == Model.UserId) .Select(x => x.ViewModel) .ToList(); @@ -52,14 +52,14 @@ namespace ComputerShopDatabaseImplement.Implements { return Context.Assemblies .Include(x => x.Components) - .ThenInclude(x => x.Assembly) + .ThenInclude(x => x.Component) .FirstOrDefault(x => x.AssemblyName == Model.AssemblyName)? .ViewModel; } return Context.Assemblies .Include(x => x.Components) - .ThenInclude(x => x.Assembly) + .ThenInclude(x => x.Component) .FirstOrDefault(x => x.Id == Model.Id)? .ViewModel; } diff --git a/ComputerShopDatabaseImplement/Implements/ComponentStorage.cs b/ComputerShopDatabaseImplement/Implements/ComponentStorage.cs index 0b0a5c2..ef48970 100644 --- a/ComputerShopDatabaseImplement/Implements/ComponentStorage.cs +++ b/ComputerShopDatabaseImplement/Implements/ComponentStorage.cs @@ -3,6 +3,7 @@ using ComputerShopContracts.SearchModels; using ComputerShopContracts.StorageContracts; using ComputerShopContracts.ViewModels; using ComputerShopDatabaseImplement.Models; +using Microsoft.EntityFrameworkCore; namespace ComputerShopDatabaseImplement.Implements { @@ -86,5 +87,56 @@ namespace ComputerShopDatabaseImplement.Implements return ExistingComponent.ViewModel; } + + public List GetComponentsWithShipments(List Models) + { + using var Context = new ComputerShopDatabase(); + + return Context.Components + .Include(x => x.ProductComponents) + .ThenInclude(x => x.Product) + .ThenInclude(x => x.Shipment) + .Where(x => + Models.Select(x => x.Id).Contains(x.Id) // Компонент, указанный пользователем, + && x.ProductComponents.Any(y => y.Product.Shipment != null)) // который содержится в товаре, имеющем партию товаров + .ToList() + .Select(x => new ReportComponentWithShipmentViewModel + { + ComponentId = x.Id, + ComponentName = x.ComponentName, + ComponentCost = x.Cost, + Shipments = x.ProductComponents + .Select(y => (y.Count, y.Product.ProductName, y.Product.Price, y.Product.Shipment!.ProviderName, y.Product.Shipment.DateShipment)) + .ToList(), + }) + .ToList(); + } + + public List GetComponentsByShipmentDate(ReportBindingModel ReportModel, UserSearchModel UserModel) + { + using var Context = new ComputerShopDatabase(); + + return Context.Components + .Where(c => c.UserId == UserModel.Id) + .Include(c => c.AssemblyComponents) + .ThenInclude(ac => ac.Assembly) + .ThenInclude(a => a.Requests.Where(r => r.DateRequest >= ReportModel.DateFrom && r.DateRequest <= ReportModel.DateTo)) + .ToList() + .SelectMany(c => c.AssemblyComponents + .SelectMany(ac => ac.Assembly.Requests.Select(r => new ReportComponentByDateViewModel + { + ComponentId = c.Id, + ComponentName = c.ComponentName, + ComponentCost = c.Cost, + AssemblyId = ac.Assembly.Id, + AssemblyName = ac.Assembly.AssemblyName, + AssemblyPrice = ac.Assembly.Price, + AssemblyCategory = ac.Assembly.Category, + RequestId = r.Id, + DateRequest = r.DateRequest, + ClientFIO = r.ClientFIO, + }))) + .ToList(); + } } } diff --git a/ComputerShopDatabaseImplement/Implements/ProductStorage.cs b/ComputerShopDatabaseImplement/Implements/ProductStorage.cs index 68c8a73..fa5ced6 100644 --- a/ComputerShopDatabaseImplement/Implements/ProductStorage.cs +++ b/ComputerShopDatabaseImplement/Implements/ProductStorage.cs @@ -16,7 +16,7 @@ namespace ComputerShopDatabaseImplement.Implements return Context.Products .Include(x => x.Shipment) .Include(x => x.Components) - .ThenInclude(x => x.Product) + .ThenInclude(x => x.Component) .Select(x => x.ViewModel) .ToList(); } @@ -31,7 +31,7 @@ namespace ComputerShopDatabaseImplement.Implements return Context.Products .Include(x => x.Shipment) .Include(x => x.Components) - .ThenInclude(x => x.Product) + .ThenInclude(x => x.Component) .Where(x => x.UserId == Model.UserId && x.ShipmentId == Model.ShipmentId) .Select(x => x.ViewModel) .ToList(); @@ -40,7 +40,7 @@ namespace ComputerShopDatabaseImplement.Implements return Context.Products .Include(x => x.Shipment) .Include(x => x.Components) - .ThenInclude(x => x.Product) + .ThenInclude(x => x.Component) .Where(x => x.UserId == Model.UserId) .Select(x => x.ViewModel) .ToList(); @@ -56,7 +56,7 @@ namespace ComputerShopDatabaseImplement.Implements return Context.Products .Include(x => x.Shipment) .Include(x => x.Components) - .ThenInclude(x => x.Product) + .ThenInclude(x => x.Component) .FirstOrDefault(x => x.ProductName == Model.ProductName)? .ViewModel; } @@ -64,7 +64,7 @@ namespace ComputerShopDatabaseImplement.Implements return Context.Products .Include(x => x.Shipment) .Include(x => x.Components) - .ThenInclude(x => x.Product) + .ThenInclude(x => x.Component) .FirstOrDefault(x => x.Id == Model.Id)? .ViewModel; } diff --git a/ComputerShopRestApi/Controllers/AssemblyController.cs b/ComputerShopRestApi/Controllers/AssemblyController.cs new file mode 100644 index 0000000..553fcfc --- /dev/null +++ b/ComputerShopRestApi/Controllers/AssemblyController.cs @@ -0,0 +1,114 @@ +using ComputerShopContracts.BindingModels; +using ComputerShopContracts.BusinessLogicContracts; +using ComputerShopContracts.SearchModels; +using ComputerShopContracts.ViewModels; +using Microsoft.AspNetCore.Mvc; + +namespace ComputerShopRestApi.Controllers +{ + [Route("api/[controller]/[action]")] + [ApiController] + public class AssemblyController : Controller + { + private readonly ILogger _logger; + private readonly IAssemblyLogic _assemblyLogic; + private readonly IReportGuarantorLogic _reportGuarantorLogic; + + public AssemblyController(IAssemblyLogic Logic, ILogger Logger, IReportGuarantorLogic reportGuarantorLogic) + { + _logger = Logger; + _assemblyLogic = Logic; + _reportGuarantorLogic = reportGuarantorLogic; + } + + [HttpGet] + public AssemblyViewModel? GetAssembly(int Id) + { + try + { + return _assemblyLogic.ReadElement(new AssemblySearchModel + { + Id = Id + }); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка получения сборки"); + throw; + } + } + + [HttpGet] + public List? GetAssemblies(int? UserId) + { + // Implementer should be able to get all assemblies for Request binding + if (UserId == null) + { + try + { + return _assemblyLogic.ReadList(null); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка получения списка всех сборок"); + throw; + } + } + + try + { + return _assemblyLogic.ReadList(new AssemblySearchModel + { + UserId = UserId + }); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка получения списка сборок пользователя с Id = {Id}", UserId); + throw; + } + } + + [HttpPost] + public void CreateAssembly(AssemblyBindingModel Model) + { + try + { + _assemblyLogic.Create(Model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка создания сборки"); + throw; + } + } + + [HttpPost] + public void UpdateAssembly(AssemblyBindingModel Model) + { + try + { + _assemblyLogic.Update(Model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка обновления сборки"); + throw; + } + } + + [HttpDelete] + public void DeleteAssembly(AssemblyBindingModel Model) + { + try + { + _assemblyLogic.Delete(Model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка удаления сборки"); + throw; + } + } + } +} diff --git a/ComputerShopRestApi/Controllers/ComponentController.cs b/ComputerShopRestApi/Controllers/ComponentController.cs new file mode 100644 index 0000000..c10054e --- /dev/null +++ b/ComputerShopRestApi/Controllers/ComponentController.cs @@ -0,0 +1,98 @@ +using ComputerShopContracts.BindingModels; +using ComputerShopContracts.BusinessLogicContracts; +using ComputerShopContracts.SearchModels; +using ComputerShopContracts.ViewModels; +using Microsoft.AspNetCore.Mvc; + +namespace ComputerShopRestApi.Controllers +{ + [Route("api/[controller]/[action]")] + [ApiController] + public class ComponentController : Controller + { + private readonly ILogger _logger; + private readonly IComponentLogic _componentLogic; + + public ComponentController(IComponentLogic Logic, ILogger Logger) + { + _logger = Logger; + _componentLogic = Logic; + } + + [HttpGet] + public ComponentViewModel? GetComponent(int Id) + { + try + { + return _componentLogic.ReadElement(new ComponentSearchModel + { + Id = Id + }); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка получения комплектующей"); + throw; + } + } + + [HttpGet] + public List? GetComponents(int? UserId) + { + try + { + return _componentLogic.ReadList(new ComponentSearchModel + { + UserId = UserId + }); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка получения списка комплектующих пользователя с Id = {Id}", UserId); + throw; + } + } + + [HttpPost] + public void CreateComponent(ComponentBindingModel Model) + { + try + { + _componentLogic.Create(Model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка создания комплектующей"); + throw; + } + } + + [HttpPost] + public void UpdateComponent(ComponentBindingModel Model) + { + try + { + _componentLogic.Update(Model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка обновления комплектующей"); + throw; + } + } + + [HttpDelete] + public void DeleteComponent(ComponentBindingModel Model) + { + try + { + _componentLogic.Delete(Model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка удаления комплектующей"); + throw; + } + } + } +} diff --git a/ComputerShopRestApi/Controllers/ProductController.cs b/ComputerShopRestApi/Controllers/ProductController.cs new file mode 100644 index 0000000..311505d --- /dev/null +++ b/ComputerShopRestApi/Controllers/ProductController.cs @@ -0,0 +1,98 @@ +using ComputerShopContracts.BindingModels; +using ComputerShopContracts.BusinessLogicContracts; +using ComputerShopContracts.SearchModels; +using ComputerShopContracts.ViewModels; +using Microsoft.AspNetCore.Mvc; + +namespace ComputerShopRestApi.Controllers +{ + [Route("api/[controller]/[action]")] + [ApiController] + public class ProductController : Controller + { + private readonly ILogger _logger; + private readonly IProductLogic _productLogic; + + public ProductController(IProductLogic Logic, ILogger Logger) + { + _logger = Logger; + _productLogic = Logic; + } + + [HttpGet] + public ProductViewModel? GetProduct(int Id) + { + try + { + return _productLogic.ReadElement(new ProductSearchModel + { + Id = Id + }); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка получения товара"); + throw; + } + } + + [HttpGet] + public List? GetProducts(int? UserId) + { + try + { + return _productLogic.ReadList(new ProductSearchModel + { + UserId = UserId + }); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка получения списка товаров пользователя с Id = {Id}", UserId); + throw; + } + } + + [HttpPost] + public void CreateProduct(ProductBindingModel Model) + { + try + { + _productLogic.Create(Model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка создания товара"); + throw; + } + } + + [HttpPost] + public void UpdateProduct(ProductBindingModel Model) + { + try + { + _productLogic.Update(Model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка обновления товара"); + throw; + } + } + + [HttpDelete] + public void DeleteProduct(ProductBindingModel Model) + { + try + { + _productLogic.Delete(Model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка удаления товара"); + throw; + } + } + } +} diff --git a/ComputerShopRestApi/Program.cs b/ComputerShopRestApi/Program.cs index 7c64ca5..eae7a0c 100644 --- a/ComputerShopRestApi/Program.cs +++ b/ComputerShopRestApi/Program.cs @@ -13,12 +13,19 @@ Builder.Services.AddTransient(); Builder.Services.AddTransient(); Builder.Services.AddTransient(); Builder.Services.AddTransient(); - +Builder.Services.AddTransient(); +Builder.Services.AddTransient(); +Builder.Services.AddTransient(); Builder.Services.AddTransient(); Builder.Services.AddTransient(); Builder.Services.AddTransient(); Builder.Services.AddTransient(); +Builder.Services.AddTransient(); +Builder.Services.AddTransient(); +Builder.Services.AddTransient(); + +Builder.Services.AddTransient(); Builder.Services.AddControllers();