public OtherDocumentItemWorkItemStrategy(bool withNestedItems = true,
                                          NestedItemWorkItemStrategy nestedItemWorkItemStrategy = null, bool withDeleted = false,
                                          bool cacheResult = false)
 {
     WithNestedItems = withNestedItems;
     if (withNestedItems && nestedItemWorkItemStrategy == null)
     {
         throw new ArgumentNullException(nameof(nestedItemWorkItemStrategy));
     }
     NestedItemWorkItemStrategy = nestedItemWorkItemStrategy;
     WithDeleted = withDeleted;
     CacheResult = cacheResult;
 }
Ejemplo n.º 2
0
        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));
        }