Compare commits
1 Commits
lab-2-no-l
...
lab-2
| Author | SHA1 | Date | |
|---|---|---|---|
| b7c31860e1 |
@@ -36,71 +36,71 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Castle.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Castle.Core.5.1.1\lib\net462\Castle.Core.dll</HintPath>
|
||||
<HintPath>..\packages\Castle.Core.5.1.1\lib\net462\Castle.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.DependencyInjection, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.DependencyInjection.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.DependencyInjection.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Logging, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.Logging.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Options, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Options.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.Options.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.Extensions.Options.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.Options.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Primitives, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Primitives.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.Primitives.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.Extensions.Primitives.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.Primitives.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Moq, Version=4.20.72.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Moq.4.20.72\lib\net462\Moq.dll</HintPath>
|
||||
<HintPath>..\packages\Moq.4.20.72\lib\net462\Moq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System"/>
|
||||
<Reference Include="System.Buffers, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll</HintPath>
|
||||
<HintPath>..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core"/>
|
||||
<Reference Include="System.Data"/>
|
||||
<Reference Include="System.Diagnostics.DiagnosticSource, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.10.0.0-preview.1.25080.5\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.10.0.0-preview.1.25080.5\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Pipelines, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.Pipelines.10.0.0-preview.1.25080.5\lib\net462\System.IO.Pipelines.dll</HintPath>
|
||||
<HintPath>..\packages\System.IO.Pipelines.10.0.0-preview.1.25080.5\lib\net462\System.IO.Pipelines.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Memory, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll</HintPath>
|
||||
<HintPath>..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll</HintPath>
|
||||
<HintPath>..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.Encodings.Web, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Encodings.Web.10.0.0-preview.1.25080.5\lib\net462\System.Text.Encodings.Web.dll</HintPath>
|
||||
<HintPath>..\packages\System.Text.Encodings.Web.10.0.0-preview.1.25080.5\lib\net462\System.Text.Encodings.Web.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Json.10.0.0-preview.1.25080.5\lib\net462\System.Text.Json.dll</HintPath>
|
||||
<HintPath>..\packages\System.Text.Json.10.0.0-preview.1.25080.5\lib\net462\System.Text.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.6.0\lib\net462\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.6.0\lib\net462\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml"/>
|
||||
</ItemGroup>
|
||||
@@ -145,16 +145,16 @@
|
||||
<Compile Include="Interfaces\StoragesContracts\ISalaryStorageContact.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ItemGroup>
|
||||
<InternalsVisibleTo Include="CatHasPawsTests" />
|
||||
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="ILLink\ILLink.Descriptors.LibraryBuild.xml" />
|
||||
<Content Include="ILLink\ILLink.Descriptors.LibraryBuild.xml" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json;
|
||||
using CandyHouseBase.DataModels;
|
||||
using CandyHouseBase.Exceptions;
|
||||
using CandyHouseBase.Extensions;
|
||||
using CandyHouseBase.Interfaces.BusinessLogicsContracts;
|
||||
using CandyHouseBase.Interfaces.StoragesContracts;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -16,24 +20,67 @@ namespace CandyHouseBase.Implementations
|
||||
|
||||
public List<IngredientDataModel> GetAllIngredients()
|
||||
{
|
||||
return new List<IngredientDataModel>();
|
||||
_logger.LogInformation("GetAllIngredients");
|
||||
var ingredients = _ingredientStorageContact.GetList() ?? throw new NullListException();
|
||||
return ingredients;
|
||||
}
|
||||
|
||||
public IngredientDataModel GetIngredientByData(string data)
|
||||
{
|
||||
return new IngredientDataModel("", "", "", 100);
|
||||
_logger.LogInformation("GetIngredientByData for data: {data}", data);
|
||||
if (data == null)
|
||||
throw new ArgumentNullException(nameof(data));
|
||||
if (string.IsNullOrEmpty(data))
|
||||
throw new ArgumentNullException(nameof(data));
|
||||
if (data.IsGuid())
|
||||
{
|
||||
var ingredient = _ingredientStorageContact.GetElementById(data);
|
||||
if (ingredient == null)
|
||||
throw new ElementNotFoundException(data);
|
||||
return ingredient;
|
||||
}
|
||||
else
|
||||
{
|
||||
var ingredient = _ingredientStorageContact.GetElementByName(data);
|
||||
if (ingredient == null)
|
||||
throw new ElementNotFoundException(data);
|
||||
return ingredient;
|
||||
}
|
||||
}
|
||||
|
||||
public void InsertIngredient(IngredientDataModel ingredient)
|
||||
{
|
||||
_logger.LogInformation("InsertIngredient: {json}", JsonSerializer.Serialize(ingredient));
|
||||
if (ingredient == null)
|
||||
throw new ArgumentNullException(nameof(ingredient));
|
||||
ingredient.Validate();
|
||||
_ingredientStorageContact.AddElement(ingredient);
|
||||
}
|
||||
|
||||
public void UpdateIngredient(IngredientDataModel ingredient)
|
||||
{
|
||||
_logger.LogInformation("UpdateIngredient: {json}", JsonSerializer.Serialize(ingredient));
|
||||
if (ingredient == null)
|
||||
throw new ArgumentNullException(nameof(ingredient));
|
||||
ingredient.Validate();
|
||||
_ingredientStorageContact.UpdateElement(ingredient);
|
||||
}
|
||||
|
||||
public void DeleteIngredient(string id)
|
||||
{
|
||||
_logger.LogInformation("DeleteIngredient for id: {id}", id);
|
||||
if (id == null)
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
if (string.IsNullOrEmpty(id))
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
if (!id.IsGuid())
|
||||
throw new ValidationException("id must be a GUID");
|
||||
|
||||
var ingredient = _ingredientStorageContact.GetElementById(id);
|
||||
if (ingredient == null)
|
||||
throw new ElementNotFoundException(id);
|
||||
|
||||
_ingredientStorageContact.DeleteElement(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json;
|
||||
using CandyHouseBase.DataModels;
|
||||
using CandyHouseBase.Enums;
|
||||
using CandyHouseBase.Exceptions;
|
||||
using CandyHouseBase.Extensions;
|
||||
using CandyHouseBase.Interfaces.BusinessLogicsContracts;
|
||||
using CandyHouseBase.Interfaces.StoragesContracts;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -22,25 +25,102 @@ namespace CandyHouseBase.Implementations
|
||||
|
||||
public List<OrderDataModel> GetAllOrders()
|
||||
{
|
||||
return new List<OrderDataModel>();
|
||||
_logger.LogInformation("GetAllOrders");
|
||||
var orders = _orderStorageContact.GetOrders() ?? throw new NullListException();
|
||||
return orders;
|
||||
}
|
||||
|
||||
public OrderDataModel GetOrderByData(string data)
|
||||
{
|
||||
return new OrderDataModel("", "", new DateTime(),
|
||||
100, 100m, "", "", StatusType.Cancelled);
|
||||
_logger.LogInformation("GetOrderByData for data: {data}", data);
|
||||
if (data == null)
|
||||
throw new ArgumentNullException(nameof(data));
|
||||
if (string.IsNullOrEmpty(data))
|
||||
throw new ArgumentNullException(nameof(data));
|
||||
if (!data.IsGuid())
|
||||
throw new ValidationException("data must be a GUID");
|
||||
|
||||
var order = _orderStorageContact.GetElementById(data) ?? throw new ElementNotFoundException(data);
|
||||
return order;
|
||||
}
|
||||
|
||||
public void InsertOrder(OrderDataModel order)
|
||||
{
|
||||
_logger.LogInformation("InsertOrder: {json}", JsonSerializer.Serialize(order));
|
||||
if (order == null)
|
||||
throw new ArgumentNullException(nameof(order));
|
||||
order.Validate();
|
||||
|
||||
// Check if Pekar exists
|
||||
if (_pekarStorageContact.GetElementById(order.PekarId) == null)
|
||||
throw new ElementNotFoundException(order.PekarId);
|
||||
|
||||
// Check if Product exists
|
||||
if (_productStorageContact.GetElementById(order.ProductId) == null)
|
||||
throw new ElementNotFoundException(order.ProductId);
|
||||
|
||||
// Check if order with this ID already exists
|
||||
var existingOrder = _orderStorageContact.GetElementById(order.Id);
|
||||
if (existingOrder != null)
|
||||
throw new ElementExistsException("ID", order.Id);
|
||||
|
||||
try
|
||||
{
|
||||
_orderStorageContact.AddElement(order);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StorageException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateOrder(OrderDataModel order)
|
||||
{
|
||||
_logger.LogInformation("UpdateOrder: {json}", JsonSerializer.Serialize(order));
|
||||
if (order == null)
|
||||
throw new ArgumentNullException(nameof(order));
|
||||
order.Validate();
|
||||
|
||||
// Check if Pekar exists
|
||||
if (_pekarStorageContact.GetElementById(order.PekarId) == null)
|
||||
throw new ElementNotFoundException(order.PekarId);
|
||||
|
||||
// Check if Product exists
|
||||
if (_productStorageContact.GetElementById(order.ProductId) == null)
|
||||
throw new ElementNotFoundException(order.ProductId);
|
||||
|
||||
try
|
||||
{
|
||||
_orderStorageContact.UpdateElement(order);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StorageException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteOrder(string id)
|
||||
{
|
||||
_logger.LogInformation("DeleteOrder for id: {id}", id);
|
||||
if (id == null)
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
if (string.IsNullOrEmpty(id))
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
if (!id.IsGuid())
|
||||
throw new ValidationException("id must be a GUID");
|
||||
|
||||
var order = _orderStorageContact.GetElementById(id);
|
||||
if (order == null)
|
||||
throw new ElementNotFoundException(id);
|
||||
|
||||
try
|
||||
{
|
||||
_orderStorageContact.DeleteElement(order);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StorageException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using CandyHouseBase.DataModels;
|
||||
using CandyHouseBase.Enums;
|
||||
using CandyHouseBase.Exceptions;
|
||||
using CandyHouseBase.Extensions;
|
||||
using CandyHouseBase.Interfaces.BusinessLogicsContracts;
|
||||
using CandyHouseBase.Interfaces.StoragesContracts;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -22,34 +27,148 @@ namespace CandyHouseBase.Implementations
|
||||
|
||||
public List<PekarDataModel> GetAllPekars()
|
||||
{
|
||||
return new List<PekarDataModel>();
|
||||
_logger.LogInformation("GetAllPekars");
|
||||
var pekars = _pekarStorageContact.GetList() ?? throw new NullListException();
|
||||
return pekars;
|
||||
}
|
||||
|
||||
public List<PekarDataModel> GetAllDataOfPekar(string pekarId)
|
||||
{
|
||||
return new List<PekarDataModel>();
|
||||
_logger.LogInformation("GetAllDataOfPekar for pekarId: {pekarId}", pekarId);
|
||||
if (pekarId.IsEmpty())
|
||||
throw new ArgumentNullException(nameof(pekarId));
|
||||
if (!pekarId.IsGuid())
|
||||
throw new ValidationException("pekarId must be a GUID");
|
||||
|
||||
var pekarsWithHistory = _pekarStorageContact.GetPekarWithHistory(pekarId);
|
||||
if (pekarsWithHistory == null || !pekarsWithHistory.Any())
|
||||
throw new ElementNotFoundException(pekarId);
|
||||
|
||||
var historyRecords = new List<PekarDataModel>();
|
||||
foreach (var pekar in pekarsWithHistory)
|
||||
{
|
||||
Guid positionGuid;
|
||||
if (!Guid.TryParse(pekar.Position, out positionGuid))
|
||||
{
|
||||
_logger.LogWarning("Invalid Position GUID: {Position}", pekar.Position);
|
||||
continue;
|
||||
}
|
||||
|
||||
var position = _positionStorageContact.GetElementById(positionGuid.ToString());
|
||||
if (position == null)
|
||||
throw new ElementNotFoundException(pekar.Position);
|
||||
historyRecords.Add(new PekarDataModel(pekar.Id, pekar.FIO, position.Id, pekar.BonusCoefficient,
|
||||
new List<ProductDataModel>()));
|
||||
}
|
||||
|
||||
if (!historyRecords.Any())
|
||||
{
|
||||
var firstPekar = pekarsWithHistory.First();
|
||||
Guid positionGuid;
|
||||
if (Guid.TryParse(firstPekar.Position, out positionGuid))
|
||||
{
|
||||
var position = _positionStorageContact.GetElementById(positionGuid.ToString());
|
||||
if (position != null)
|
||||
historyRecords.Add(new PekarDataModel(firstPekar.Id, firstPekar.FIO, position.Id,
|
||||
firstPekar.BonusCoefficient,
|
||||
new List<ProductDataModel>()));
|
||||
}
|
||||
}
|
||||
|
||||
return historyRecords;
|
||||
}
|
||||
|
||||
public PekarDataModel GetPekarByData(string data)
|
||||
{
|
||||
return new PekarDataModel("", "", "",
|
||||
0, new List<ProductDataModel>());
|
||||
_logger.LogInformation("GetPekarByData for data: {data}", data);
|
||||
if (data.IsEmpty())
|
||||
throw new ArgumentNullException(nameof(data));
|
||||
if (!data.IsGuid() && !Regex.IsMatch(data, @"^[A-Za-zА-Яа-яЁё\s\-]+$"))
|
||||
throw new ValidationException("data must be a GUID or FIO");
|
||||
|
||||
var pekar = _pekarStorageContact.GetElementById(data) ?? _pekarStorageContact.GetElementByFio(data) ??
|
||||
throw new ElementNotFoundException(data);
|
||||
return pekar;
|
||||
}
|
||||
|
||||
public void InsertPekar(PekarDataModel order)
|
||||
public void InsertPekar(PekarDataModel pekar)
|
||||
{
|
||||
_logger.LogInformation("InsertPekar: {json}", JsonSerializer.Serialize(pekar));
|
||||
if (pekar == null)
|
||||
throw new ArgumentNullException(nameof(pekar));
|
||||
|
||||
pekar.Validate();
|
||||
|
||||
var existingPekar = _pekarStorageContact.GetElementById(pekar.Id);
|
||||
if (existingPekar != null)
|
||||
{
|
||||
var history = new PekarHistoryDataModel(
|
||||
existingPekar.Id,
|
||||
existingPekar.FIO,
|
||||
existingPekar.Position,
|
||||
existingPekar.BonusCoefficient,
|
||||
DateTime.Now
|
||||
);
|
||||
}
|
||||
|
||||
foreach (var product in pekar.ProductsItems)
|
||||
{
|
||||
if (_productStorageContact.GetElementById(product.Id) == null)
|
||||
throw new ElementNotFoundException(product.Id);
|
||||
}
|
||||
|
||||
_pekarStorageContact.AddElement(pekar);
|
||||
}
|
||||
|
||||
public void UpdatePekar(PekarDataModel order)
|
||||
public void UpdatePekar(PekarDataModel pekar)
|
||||
{
|
||||
_logger.LogInformation("UpdatePekar: {json}", JsonSerializer.Serialize(pekar));
|
||||
if (pekar == null)
|
||||
throw new ArgumentNullException(nameof(pekar));
|
||||
|
||||
pekar.Validate();
|
||||
|
||||
foreach (var product in pekar.ProductsItems)
|
||||
{
|
||||
if (_productStorageContact.GetElementById(product.Id) == null)
|
||||
throw new ElementNotFoundException(product.Id);
|
||||
}
|
||||
|
||||
_pekarStorageContact.UpdateElement(pekar);
|
||||
}
|
||||
|
||||
public void DeletePekar(string id)
|
||||
{
|
||||
_logger.LogInformation("DeletePekar for id: {id}", id);
|
||||
if (id == null)
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
if (string.IsNullOrEmpty(id))
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
if (!id.IsGuid())
|
||||
throw new ValidationException("id must be a GUID");
|
||||
|
||||
var pekar = _pekarStorageContact.GetElementById(id);
|
||||
if (pekar == null)
|
||||
throw new ElementNotFoundException(id);
|
||||
|
||||
_pekarStorageContact.DeleteElement(id);
|
||||
}
|
||||
|
||||
public void RestorePekar(string id)
|
||||
{
|
||||
_logger.LogInformation("RestorePekar for id: {id}", id);
|
||||
if (id == null)
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
if (string.IsNullOrEmpty(id))
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
if (!id.IsGuid())
|
||||
throw new ValidationException("id must be a GUID");
|
||||
|
||||
var pekar = _pekarStorageContact.GetElementById(id);
|
||||
if (pekar == null)
|
||||
throw new ElementNotFoundException(id);
|
||||
|
||||
_pekarStorageContact.RestoreElement(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json;
|
||||
using CandyHouseBase.DataModels;
|
||||
using CandyHouseBase.Enums;
|
||||
using CandyHouseBase.Exceptions;
|
||||
using CandyHouseBase.Extensions;
|
||||
using CandyHouseBase.Interfaces.BusinessLogicsContracts;
|
||||
using CandyHouseBase.Interfaces.StoragesContracts;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -18,24 +21,67 @@ namespace CandyHouseBase.Implementations
|
||||
|
||||
public List<PositionDataModel> GetAllPositions()
|
||||
{
|
||||
return new List<PositionDataModel>();
|
||||
_logger.LogInformation("GetAllPositions");
|
||||
var positions = _positionStorageContact.GetList() ?? throw new NullListException();
|
||||
return positions;
|
||||
}
|
||||
|
||||
public PositionDataModel GetPositionByData(string data)
|
||||
{
|
||||
return new PositionDataModel("", PositionType.Cool, "");
|
||||
_logger.LogInformation("GetPositionByData for data: {data}", data);
|
||||
if (data.IsEmpty())
|
||||
throw new ArgumentNullException(nameof(data));
|
||||
|
||||
var position = _positionStorageContact.GetElementById(data);
|
||||
if (position == null)
|
||||
throw new ElementNotFoundException(data);
|
||||
if (!data.IsGuid())
|
||||
throw new ValidationException("data must be a GUID");
|
||||
|
||||
return position;
|
||||
}
|
||||
|
||||
public void InsertPosition(PositionDataModel position)
|
||||
{
|
||||
_logger.LogInformation("InsertPosition: {json}", JsonSerializer.Serialize(position));
|
||||
if (position == null)
|
||||
throw new ArgumentNullException(nameof(position));
|
||||
|
||||
position.Validate();
|
||||
_positionStorageContact.AddElement(position);
|
||||
}
|
||||
|
||||
public void UpdatePosition(PositionDataModel position)
|
||||
{
|
||||
_logger.LogInformation("UpdatePosition: {json}", JsonSerializer.Serialize(position));
|
||||
if (position == null)
|
||||
throw new ArgumentNullException(nameof(position));
|
||||
|
||||
position.Validate();
|
||||
_positionStorageContact.UpdateElement(position);
|
||||
}
|
||||
|
||||
public void DeletePosition(string id)
|
||||
{
|
||||
_logger.LogInformation("DeletePosition for id: {id}", id);
|
||||
if (id.IsEmpty())
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
if (!id.IsGuid())
|
||||
throw new ValidationException("id must be a GUID");
|
||||
|
||||
var position = _positionStorageContact.GetElementById(id);
|
||||
if (position == null)
|
||||
throw new ElementNotFoundException(id);
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
_positionStorageContact.DeleteElement(id);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StorageException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
using CandyHouseBase.DataModels;
|
||||
using CandyHouseBase.Enums;
|
||||
using CandyHouseBase.Exceptions;
|
||||
using CandyHouseBase.Extensions;
|
||||
using CandyHouseBase.Interfaces.BusinessLogicsContracts;
|
||||
using CandyHouseBase.Interfaces.StoragesContracts;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -20,24 +23,92 @@ namespace CandyHouseBase.Implementations
|
||||
|
||||
public List<ProductDataModel> GetAllProducts()
|
||||
{
|
||||
return new List<ProductDataModel>();
|
||||
_logger.LogInformation("GetAllProducts");
|
||||
var products = _productStorageContact.GetList() ?? throw new NullListException();
|
||||
return products;
|
||||
}
|
||||
|
||||
public ProductDataModel GetProductByData(string data)
|
||||
{
|
||||
return new ProductDataModel("", "", "", new List<IngredientDataModel>());
|
||||
_logger.LogInformation("GetProductByData for data: {data}", data);
|
||||
if (data == null)
|
||||
throw new ArgumentNullException(nameof(data));
|
||||
if (string.IsNullOrEmpty(data))
|
||||
throw new ArgumentNullException(nameof(data));
|
||||
|
||||
if (data.IsGuid())
|
||||
{
|
||||
var product = _productStorageContact.GetElementById(data);
|
||||
if (product == null)
|
||||
throw new ElementNotFoundException(data);
|
||||
if (!data.IsGuid()) // Validate after existence check (redundant but kept for consistency)
|
||||
throw new ValidationException("data must be a GUID");
|
||||
return product;
|
||||
}
|
||||
else
|
||||
{
|
||||
var products = _productStorageContact.GetList();
|
||||
var productByName = products.FirstOrDefault(p => p.Name == data || (p.OldName != null && p.OldName == data));
|
||||
if (productByName == null)
|
||||
throw new ElementNotFoundException(data);
|
||||
return productByName;
|
||||
}
|
||||
}
|
||||
|
||||
public void InsertProduct(ProductDataModel product)
|
||||
{
|
||||
_logger.LogInformation("InsertProduct: {json}", JsonSerializer.Serialize(product));
|
||||
if (product == null)
|
||||
throw new ArgumentNullException(nameof(product));
|
||||
product.Validate();
|
||||
|
||||
foreach (var ingredient in product.IngredientsItems)
|
||||
{
|
||||
if (_ingredientStorageContact.GetElementById(ingredient.Id) == null)
|
||||
throw new ElementNotFoundException(ingredient.Id);
|
||||
}
|
||||
|
||||
_productStorageContact.AddElement(product);
|
||||
}
|
||||
|
||||
public void UpdateProduct(ProductDataModel product)
|
||||
{
|
||||
_logger.LogInformation("UpdateProduct: {json}", JsonSerializer.Serialize(product));
|
||||
if (product == null)
|
||||
throw new ArgumentNullException(nameof(product));
|
||||
product.Validate();
|
||||
|
||||
foreach (var ingredient in product.IngredientsItems)
|
||||
{
|
||||
if (_ingredientStorageContact.GetElementById(ingredient.Id) == null)
|
||||
throw new ElementNotFoundException(ingredient.Id);
|
||||
}
|
||||
|
||||
_productStorageContact.UpdateElement(product);
|
||||
}
|
||||
|
||||
public void DeleteProduct(string id)
|
||||
{
|
||||
_logger.LogInformation("DeleteProduct for id: {id}", id);
|
||||
if (id == null)
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
if (string.IsNullOrEmpty(id))
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
if (!id.IsGuid())
|
||||
throw new ValidationException("id must be a GUID");
|
||||
|
||||
var product = _productStorageContact.GetElementById(id);
|
||||
if (product == null)
|
||||
throw new ElementNotFoundException(id);
|
||||
|
||||
try
|
||||
{
|
||||
_productStorageContact.DeleteElement(id);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StorageException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,24 +22,64 @@ namespace CandyHouseBase.Implementations
|
||||
|
||||
public List<SalaryDataModel> GetAllSalaries()
|
||||
{
|
||||
return new List<SalaryDataModel>();
|
||||
_logger.LogInformation("GetAllSalaries");
|
||||
var salaries = _salaryStorageContact.GetList() ?? throw new NullListException();
|
||||
return salaries;
|
||||
}
|
||||
|
||||
public SalaryDataModel GetSalaryByData(string data)
|
||||
{
|
||||
return new SalaryDataModel("", "", new DateTime(), 0, 0, 0);
|
||||
_logger.LogInformation("GetSalaryByData for data: {data}", data);
|
||||
if (data == null)
|
||||
throw new ArgumentNullException(nameof(data));
|
||||
if (string.IsNullOrEmpty(data))
|
||||
throw new ArgumentNullException(nameof(data));
|
||||
if (!data.IsGuid())
|
||||
throw new ValidationException("data must be a GUID");
|
||||
|
||||
var salary = _salaryStorageContact.GetElementById(data) ?? throw new ElementNotFoundException(data);
|
||||
if (_pekarStorageContact.GetElementById(salary.PekarId) == null)
|
||||
throw new ElementNotFoundException(salary.PekarId);
|
||||
return salary;
|
||||
}
|
||||
|
||||
public void InsertSalary(SalaryDataModel salary)
|
||||
{
|
||||
_logger.LogInformation("InsertSalary: {json}", JsonSerializer.Serialize(salary));
|
||||
if (salary == null)
|
||||
throw new ArgumentNullException(nameof(salary));
|
||||
salary.Validate();
|
||||
if (_pekarStorageContact.GetElementById(salary.PekarId) == null)
|
||||
throw new ElementNotFoundException(salary.PekarId);
|
||||
_salaryStorageContact.AddElement(salary);
|
||||
}
|
||||
|
||||
public void UpdateSalary(SalaryDataModel salary)
|
||||
{
|
||||
_logger.LogInformation("UpdateSalary: {json}", JsonSerializer.Serialize(salary));
|
||||
if (salary == null)
|
||||
throw new ArgumentNullException(nameof(salary));
|
||||
salary.Validate();
|
||||
if (_pekarStorageContact.GetElementById(salary.PekarId) == null)
|
||||
throw new ElementNotFoundException(salary.PekarId);
|
||||
_salaryStorageContact.UpdateElement(salary);
|
||||
}
|
||||
|
||||
public void DeleteSalary(string id)
|
||||
{
|
||||
_logger.LogInformation("DeleteSalary for id: {id}", id);
|
||||
if (id == null)
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
if (string.IsNullOrEmpty(id))
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
if (!id.IsGuid())
|
||||
throw new ValidationException("id must be a GUID");
|
||||
|
||||
var salary = _salaryStorageContact.GetElementById(id);
|
||||
if (salary == null)
|
||||
throw new ElementNotFoundException(id);
|
||||
|
||||
_salaryStorageContact.DeleteElement(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,108 +39,108 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Castle.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Castle.Core.5.1.1\lib\net462\Castle.Core.dll</HintPath>
|
||||
<HintPath>..\packages\Castle.Core.5.1.1\lib\net462\Castle.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationInsights, Version=2.22.0.997, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.ApplicationInsights.2.22.0\lib\net46\Microsoft.ApplicationInsights.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.ApplicationInsights.2.22.0\lib\net46\Microsoft.ApplicationInsights.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.Extensions.DependencyInjection, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.DependencyInjection.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.DependencyInjection.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Logging, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.Logging.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Options, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Options.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.Options.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.Extensions.Options.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.Options.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Primitives, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Primitives.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.Primitives.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.Extensions.Primitives.10.0.0-preview.1.25080.5\lib\net462\Microsoft.Extensions.Primitives.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Testing.Extensions.MSBuild, Version=1.5.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Testing.Platform.MSBuild.1.5.3\lib\netstandard2.0\Microsoft.Testing.Extensions.MSBuild.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.Testing.Platform.MSBuild.1.5.3\lib\netstandard2.0\Microsoft.Testing.Extensions.MSBuild.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Testing.Extensions.Telemetry, Version=1.5.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Testing.Extensions.Telemetry.1.5.3\lib\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.Testing.Extensions.Telemetry.1.5.3\lib\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Testing.Extensions.TrxReport.Abstractions, Version=1.5.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Testing.Extensions.TrxReport.Abstractions.1.5.3\lib\netstandard2.0\Microsoft.Testing.Extensions.TrxReport.Abstractions.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.Testing.Extensions.TrxReport.Abstractions.1.5.3\lib\netstandard2.0\Microsoft.Testing.Extensions.TrxReport.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Testing.Extensions.VSTestBridge, Version=1.5.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Testing.Extensions.VSTestBridge.1.5.3\lib\netstandard2.0\Microsoft.Testing.Extensions.VSTestBridge.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.Testing.Extensions.VSTestBridge.1.5.3\lib\netstandard2.0\Microsoft.Testing.Extensions.VSTestBridge.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Testing.Platform, Version=1.5.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Testing.Platform.1.5.3\lib\netstandard2.0\Microsoft.Testing.Platform.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.Testing.Platform.1.5.3\lib\netstandard2.0\Microsoft.Testing.Platform.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.TestPlatform.CoreUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.TestPlatform.ObjectModel.17.12.0\lib\net462\Microsoft.TestPlatform.CoreUtilities.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.TestPlatform.ObjectModel.17.12.0\lib\net462\Microsoft.TestPlatform.CoreUtilities.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.TestPlatform.PlatformAbstractions, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.TestPlatform.ObjectModel.17.12.0\lib\net462\Microsoft.TestPlatform.PlatformAbstractions.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.TestPlatform.ObjectModel.17.12.0\lib\net462\Microsoft.TestPlatform.PlatformAbstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestPlatform.ObjectModel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.TestPlatform.ObjectModel.17.12.0\lib\net462\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.TestPlatform.ObjectModel.17.12.0\lib\net462\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Moq, Version=4.20.72.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Moq.4.20.72\lib\net462\Moq.dll</HintPath>
|
||||
<HintPath>..\packages\Moq.4.20.72\lib\net462\Moq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll</HintPath>
|
||||
<HintPath>..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Collections.Immutable.1.5.0\lib\netstandard2.0\System.Collections.Immutable.dll</HintPath>
|
||||
<HintPath>..\packages\System.Collections.Immutable.1.5.0\lib\netstandard2.0\System.Collections.Immutable.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Diagnostics.DiagnosticSource, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.10.0.0-preview.1.25080.5\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.10.0.0-preview.1.25080.5\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Pipelines, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.Pipelines.10.0.0-preview.1.25080.5\lib\net462\System.IO.Pipelines.dll</HintPath>
|
||||
<HintPath>..\packages\System.IO.Pipelines.10.0.0-preview.1.25080.5\lib\net462\System.IO.Pipelines.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Memory, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll</HintPath>
|
||||
<HintPath>..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll</HintPath>
|
||||
<HintPath>..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Reflection.Metadata, Version=1.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Reflection.Metadata.1.6.0\lib\netstandard2.0\System.Reflection.Metadata.dll</HintPath>
|
||||
<HintPath>..\packages\System.Reflection.Metadata.1.6.0\lib\netstandard2.0\System.Reflection.Metadata.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime" />
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Text.Encodings.Web, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Encodings.Web.10.0.0-preview.1.25080.5\lib\net462\System.Text.Encodings.Web.dll</HintPath>
|
||||
<HintPath>..\packages\System.Text.Encodings.Web.10.0.0-preview.1.25080.5\lib\net462\System.Text.Encodings.Web.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Json.10.0.0-preview.1.25080.5\lib\net462\System.Text.Json.dll</HintPath>
|
||||
<HintPath>..\packages\System.Text.Json.10.0.0-preview.1.25080.5\lib\net462\System.Text.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.6.0\lib\net462\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.6.0\lib\net462\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="nunit.framework, Version=3.5.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb">
|
||||
@@ -164,29 +164,29 @@
|
||||
<Compile Include="DataModelsTests\SalaryDataModelTests.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CandyHouseBase\CandyHouseBase.csproj">
|
||||
<Project>{5df70b46-31f7-4d15-8c60-52c0a0a364f0}</Project>
|
||||
<Name>CandyHouseBase</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\CandyHouseBase\CandyHouseBase.csproj">
|
||||
<Project>{5df70b46-31f7-4d15-8c60-52c0a0a364f0}</Project>
|
||||
<Name>CandyHouseBase</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="ILLink\ILLink.Descriptors.LibraryBuild.xml" />
|
||||
<Content Include="ILLink\ILLink.Descriptors.LibraryBuild.xml" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\Microsoft.Testing.Platform.1.5.3\build\netstandard2.0\Microsoft.Testing.Platform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Platform.1.5.3\build\netstandard2.0\Microsoft.Testing.Platform.props'))" />
|
||||
<Error Condition="!Exists('..\packages\Microsoft.Testing.Platform.MSBuild.1.5.3\build\Microsoft.Testing.Platform.MSBuild.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Platform.MSBuild.1.5.3\build\Microsoft.Testing.Platform.MSBuild.props'))" />
|
||||
<Error Condition="!Exists('..\packages\Microsoft.Testing.Platform.MSBuild.1.5.3\build\Microsoft.Testing.Platform.MSBuild.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Platform.MSBuild.1.5.3\build\Microsoft.Testing.Platform.MSBuild.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Microsoft.Testing.Extensions.Telemetry.1.5.3\build\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Extensions.Telemetry.1.5.3\build\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.props'))" />
|
||||
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.5.0.0\build\net462\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.5.0.0\build\net462\NUnit3TestAdapter.props'))" />
|
||||
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.5.0.0\build\net462\NUnit3TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.5.0.0\build\net462\NUnit3TestAdapter.targets'))" />
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\Microsoft.Testing.Platform.1.5.3\build\netstandard2.0\Microsoft.Testing.Platform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Platform.1.5.3\build\netstandard2.0\Microsoft.Testing.Platform.props'))" />
|
||||
<Error Condition="!Exists('..\packages\Microsoft.Testing.Platform.MSBuild.1.5.3\build\Microsoft.Testing.Platform.MSBuild.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Platform.MSBuild.1.5.3\build\Microsoft.Testing.Platform.MSBuild.props'))" />
|
||||
<Error Condition="!Exists('..\packages\Microsoft.Testing.Platform.MSBuild.1.5.3\build\Microsoft.Testing.Platform.MSBuild.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Platform.MSBuild.1.5.3\build\Microsoft.Testing.Platform.MSBuild.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Microsoft.Testing.Extensions.Telemetry.1.5.3\build\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Extensions.Telemetry.1.5.3\build\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.props'))" />
|
||||
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.5.0.0\build\net462\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.5.0.0\build\net462\NUnit3TestAdapter.props'))" />
|
||||
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.5.0.0\build\net462\NUnit3TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.5.0.0\build\net462\NUnit3TestAdapter.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\Microsoft.Testing.Platform.MSBuild.1.5.3\build\Microsoft.Testing.Platform.MSBuild.targets" Condition="Exists('..\packages\Microsoft.Testing.Platform.MSBuild.1.5.3\build\Microsoft.Testing.Platform.MSBuild.targets')" />
|
||||
<Import Project="..\packages\NUnit3TestAdapter.5.0.0\build\net462\NUnit3TestAdapter.targets" Condition="Exists('..\packages\NUnit3TestAdapter.5.0.0\build\net462\NUnit3TestAdapter.targets')" />
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<package id="Microsoft.Extensions.Logging.Abstractions" version="10.0.0-preview.1.25080.5" targetFramework="net471" />
|
||||
<package id="Microsoft.Extensions.Options" version="10.0.0-preview.1.25080.5" targetFramework="net471" />
|
||||
<package id="Moq" version="4.20.72" targetFramework="net471" />
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net471" />
|
||||
<package id="System.Diagnostics.DiagnosticSource" version="10.0.0-preview.1.25080.5" targetFramework="net471" />
|
||||
<package id="Microsoft.Extensions.Primitives" version="10.0.0-preview.1.25080.5" targetFramework="net471" />
|
||||
<package id="Microsoft.TestPlatform.ObjectModel" version="17.12.0" targetFramework="net471" />
|
||||
|
||||
Reference in New Issue
Block a user