fix
This commit is contained in:
parent
7892937ffd
commit
dd375bcbe2
@ -50,14 +50,14 @@ namespace ComputerShopFileImplement.Implements
|
||||
public ComputerViewModel? Insert(ComputerBindingModel model)
|
||||
{
|
||||
model.Id = source.Computers.Count > 0 ? source.Computers.Max(x => x.Id) + 1 : 1;
|
||||
var newDoc = Computer.Create(model);
|
||||
if (newDoc == null)
|
||||
var newComp = Computer.Create(model);
|
||||
if (newComp == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
source.Computers.Add(newDoc);
|
||||
source.Computers.Add(newComp);
|
||||
source.SaveComputers();
|
||||
return newDoc.GetViewModel;
|
||||
return newComp.GetViewModel;
|
||||
}
|
||||
|
||||
public ComputerViewModel? Update(ComputerBindingModel model)
|
||||
|
Loading…
x
Reference in New Issue
Block a user