This commit is contained in:
Павел Сорокин 2023-04-06 14:56:18 +04:00
parent a66d12738d
commit b1c29923a5
2 changed files with 2 additions and 1 deletions

View File

@ -23,6 +23,7 @@ namespace ShipyardDataBaseImplement.Implements
{
var deletedElement = context.Orders
.Include(x => x.Ship)
.Include(x => x.Client)
.FirstOrDefault(x => x.Id == model.Id)
?.GetViewModel;
context.Orders.Remove(element);

View File

@ -62,7 +62,7 @@ namespace ShipyardFileImplement.Implements
public ClientViewModel? Insert(ClientBindingModel model)
{
model.Id = source.Clients.Count > 0 ? source.Ships.Max(x => x.Id) + 1 : 1;
model.Id = source.Clients.Count > 0 ? source.Clients.Max(x => x.Id) + 1 : 1;
var newClient = Client.Create(model);
if (newClient == null)
{