исправил ошибки

This commit is contained in:
antoc0der 2024-03-15 22:27:17 +04:00
parent 357e9bb315
commit e3dfb7b0c0

View File

@ -67,25 +67,25 @@ namespace FlowerShopFileImplement.Implements
public FlowerViewModel? Update(FlowerBindingModel model)
{
var iceCream = source.Flowers.FirstOrDefault(x => x.Id ==
var flower = source.Flowers.FirstOrDefault(x => x.Id ==
model.Id);
if (iceCream == null)
if (flower == null)
{
return null;
}
iceCream.Update(model);
flower.Update(model);
source.SaveFlowers();
return iceCream.GetViewModel;
return flower.GetViewModel;
}
public FlowerViewModel? Delete(FlowerBindingModel model)
{
var iceCream = source.Flowers.FirstOrDefault(x => x.Id ==
var flower = source.Flowers.FirstOrDefault(x => x.Id ==
model.Id);
if (iceCream != null)
if (flower != null)
{
source.Flowers.Remove(iceCream);
source.Flowers.Remove(flower);
source.SaveFlowers();
return iceCream.GetViewModel;
return flower.GetViewModel;
}
return null;
}