public IReadOnlyCollection <OtherDocumentItem> GetByOtherDocumentId(int otherDocumentId, OtherDocumentItemWorkItemStrategy otherDocumentItemWorkItemStrategy) { var spec = new Specification <OtherDocumentItemDto>(w => w.OtherDocumentId == otherDocumentId).And( ToSpecification(otherDocumentItemWorkItemStrategy)); return(Repository.GetBySpecification(specification: spec).Select(w => w.Reconstitute()).ToList()); }
public IActionResult OtherDocumentInfo( int id, bool attachments = true, bool payments = true, bool items = true, bool cacheResult = true, bool deleted = false, bool withNestedItems = true, bool withOneMoreNestedItems = true ) { var nestedItemWorkItemStrategy = new NestedItemWorkItemStrategy(withOneMoreNestedItems, deleted, cacheResult); var otherDocumentItemWorkItemStrategy = new OtherDocumentItemWorkItemStrategy(withNestedItems, nestedItemWorkItemStrategy, deleted, cacheResult); var otherDocumentPaymentWorkItemStrategy = new OtherDocumentPaymentWorkItemStrategy(deleted, cacheResult); var strategy = new OtherDocumentWorkItemStrategy(deleted, attachments, payments, items, cacheResult, otherDocumentItemWorkItemStrategy, otherDocumentPaymentWorkItemStrategy); var document = _otherDocumentService.Get(id, strategy); return(Ok(document)); }