Beispiel #1
0
 // for use in 'using()' statements. ActivityGrant is enabled only for the duration of the block and is disabled at the end automatically.
 // Ex:
 //   using (editActivityGrant.Execute(context, payDoc, payDoc.Id )) {
 //     doStuff();
 //   }
 public IDisposable Execute(OperationContext context, object root = null, object rootId = null)
 {
     var token = new DynamicGrantToken() { Context = context, Grant = this };
       try {
     Begin(context, root, rootId);
     return token;
       } catch (Exception) {
     token.Dispose();
     throw;
       }
 }
        // for use in 'using()' statements. ActivityGrant is enabled only for the duration of the block and is disabled at the end automatically.
        // Ex:
        //   using (editActivityGrant.Execute(context, payDoc, payDoc.Id )) {
        //     doStuff();
        //   }
        public IDisposable Execute(OperationContext context, object root = null, object rootId = null)
        {
            var token = new DynamicGrantToken()
            {
                Context = context, Grant = this
            };

            try {
                Begin(context, root, rootId);
                return(token);
            } catch (Exception) {
                token.Dispose();
                throw;
            }
        }