This commit is contained in:
Илья Федотов 2024-05-27 18:06:34 +04:00
parent 4f4ca4e948
commit 4ab0533d8b
4 changed files with 4 additions and 5 deletions

View File

@ -11,7 +11,7 @@ namespace ElectronicsShopContracts.BusinessLogicContracts
{
public interface IProductLogic
{
List<ProductViewModel>? ReadList(ProductSearchModel model);
List<ProductViewModel>? ReadList(ProductSearchModel? model);
ProductViewModel? ReadElement(ProductSearchModel model);
bool Create(ProductBindingModel model);

View File

@ -35,9 +35,6 @@
<th>
Сумма
</th>
<th>
Статус оплаты
</th>
</th>
</thead>
<tbody>

View File

@ -40,7 +40,7 @@ namespace ElectronicsShopRestAPI.Controllers {
[HttpGet]
public List<ProductViewModel>? GetProducts() {
try {
return _product.ReadList(new ProductSearchModel {});
return _product.ReadList(null);
}
catch (Exception ex) {
_logger.LogError(ex, $"Ошибка получения данных");

View File

@ -12,9 +12,11 @@ var builder = WebApplication.CreateBuilder(args);
builder.Services.AddTransient<IClientStorage, ClientStorage>();
builder.Services.AddTransient<IEmployeeStorage, EmployeeStorage>();
builder.Services.AddTransient<IProductStorage, ProductStorage>();
builder.Services.AddTransient<IClientLogic, ClientLogic>();
builder.Services.AddTransient<IEmployeeLogic, EmployeeLogic>();
builder.Services.AddTransient<IProductLogic, ProductLogic>();
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle