Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
        public override void Save(Document entity, IWorkItemStrategy documentWorkItemStrategy = null)
        {
            switch (entity)
            {
            case OtherDocument otherDocument:
                _otherDocumentService.Save(otherDocument, documentWorkItemStrategy);
                break;
                // another document types...
            }

            throw new ArgumentOutOfRangeException(nameof(entity));
        }