public IActionResult UpdateOtherDocument(int id, OtherDocumentEditViewModel viewModel) { _otherDocumentService.Save(viewModel.GetModel() /* * Сюда нужно передать стратегию обновления, так как мы не знаем как именно данные запрашивались, * судя по всему он будет храниться во viewModel и отдаваться клиенту и возвращаться, либо формировать основываясь на бизнес логике */); var updatedOtherDocument = _otherDocumentService.Get(id); return(Ok(updatedOtherDocument)); }
public IActionResult UpdateOtherDocument(int id) { var strategy = new OtherDocumentWorkItemStrategy(withDeleted: false, withAttachments: true, withPayments: false, withItems: true, cacheResult: false, otherDocumentItemWorkItemStrategy: new OtherDocumentItemWorkItemStrategy(true, new NestedItemWorkItemStrategy())); var otherDocument = _otherDocumentService.Get(id, strategy); var viewModel = new OtherDocumentEditViewModel(otherDocument); MakeUserEdit(ref viewModel); _otherDocumentService.Save(viewModel.GetModel(), strategy); return(Ok()); }
public IActionResult InsertOtherDocument(int id, OtherDocumentEditViewModel viewModel) { _otherDocumentService.Save(viewModel.GetModel()); return(Ok()); }