исправил ошибки
This commit is contained in:
parent
357e9bb315
commit
e3dfb7b0c0
@ -67,25 +67,25 @@ namespace FlowerShopFileImplement.Implements
|
|||||||
|
|
||||||
public FlowerViewModel? Update(FlowerBindingModel model)
|
public FlowerViewModel? Update(FlowerBindingModel model)
|
||||||
{
|
{
|
||||||
var iceCream = source.Flowers.FirstOrDefault(x => x.Id ==
|
var flower = source.Flowers.FirstOrDefault(x => x.Id ==
|
||||||
model.Id);
|
model.Id);
|
||||||
if (iceCream == null)
|
if (flower == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
iceCream.Update(model);
|
flower.Update(model);
|
||||||
source.SaveFlowers();
|
source.SaveFlowers();
|
||||||
return iceCream.GetViewModel;
|
return flower.GetViewModel;
|
||||||
}
|
}
|
||||||
public FlowerViewModel? Delete(FlowerBindingModel model)
|
public FlowerViewModel? Delete(FlowerBindingModel model)
|
||||||
{
|
{
|
||||||
var iceCream = source.Flowers.FirstOrDefault(x => x.Id ==
|
var flower = source.Flowers.FirstOrDefault(x => x.Id ==
|
||||||
model.Id);
|
model.Id);
|
||||||
if (iceCream != null)
|
if (flower != null)
|
||||||
{
|
{
|
||||||
source.Flowers.Remove(iceCream);
|
source.Flowers.Remove(flower);
|
||||||
source.SaveFlowers();
|
source.SaveFlowers();
|
||||||
return iceCream.GetViewModel;
|
return flower.GetViewModel;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user