diff --git a/PersonnelDepartmentView/PersonnelDepartmentDatabaseImplement/Implements/DealStorage.cs b/PersonnelDepartmentView/PersonnelDepartmentDatabaseImplement/Implements/DealStorage.cs index 0c19260..7892d0d 100644 --- a/PersonnelDepartmentView/PersonnelDepartmentDatabaseImplement/Implements/DealStorage.cs +++ b/PersonnelDepartmentView/PersonnelDepartmentDatabaseImplement/Implements/DealStorage.cs @@ -93,7 +93,7 @@ namespace PersonnelDepartmentDatabaseImplement.Implements using var context = new PersonnelDepartmentDatabase(); context.Deals.Add(newElement); context.SaveChanges(); - return newElement.GetViewModel; + return GetElement(new DealSearchModel { Id = newElement.Id } ); } public DealViewModel? Update(DealBindingModel model) @@ -111,7 +111,7 @@ namespace PersonnelDepartmentDatabaseImplement.Implements } element.Update(model); context.SaveChanges(); - return element.GetViewModel; + return GetElement(new DealSearchModel { Id = element.Id }); } } }