Fix names

This commit is contained in:
shadowik 2023-05-04 08:57:52 +04:00
parent c591edeb20
commit d0f477cbb7
3 changed files with 11 additions and 4 deletions

View File

@ -100,6 +100,8 @@ namespace PizzeriaBusinessLogic.BusinessLogics
{
throw new ArgumentException("Магазина не существует");
}
if (shop.ShopPizzas.ContainsKey(model.PizzaId))
{
var oldValue = shop.ShopPizzas[model.PizzaId];

View File

@ -1,4 +1,5 @@
using System;
using PizzeriaDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -8,7 +9,7 @@ namespace PizzeriaContracts.ViewModels
{
public class PizzaCount
{
public PizzaViewModel Pizza { get; set; } = new();
public PizzaViewModel Pizza { get; set; }
public int Count { get; set; } = new();
}

View File

@ -61,7 +61,11 @@ namespace PizzeriaShopRestApi.Controllers
return new ShopPizzaViewModel
{
Shop = shop,
ShopPizza = shop?.ShopPizzas?.ToDictionary(x => x.Key, x => new PizzaCount{ Pizza = x.Value.Item1 as PizzaViewModel, Count = x.Value.Item2 })
ShopPizza = shop.ShopPizzas.ToDictionary(x => x.Key, x => new PizzaCount { Pizza = new PizzaViewModel() { Id = x.Value.Item1.Id,
PizzaName = x.Value.Item1.PizzaName,
PizzaComponents = x.Value.Item1.PizzaComponents,
Price = x.Value.Item1.Price,
}, Count = x.Value.Item2 })
};
}
catch (Exception ex)
@ -108,7 +112,7 @@ namespace PizzeriaShopRestApi.Controllers
}
[HttpDelete]
public void DeleteShop(int shopId,string password)
public void DeleteShop(int shopId, string password)
{
if (!CheckPassword(password))
{