private static void SetAclCacheProvider(
            HttpConfiguration config,
            Func<ICache> cacheProvider)
        {
            if (cacheProvider.IsNull()) return;

            config
                .GetAclConfiguration()
                .RegisterAclCacheProvider(cacheProvider);
        }
Example #2
0
 protected ActionResult ValidateAndSendCommand(Command command, Func<ActionResult> successFunc, Func<ActionResult> failFunc, Func<ActionResult> validationFailFunc = null, Func<bool> preCondition = null, Func<ActionResult> preConditionResult = null)
 {
     if (preCondition.IsNull() || preCondition())
     {
         if (ModelState.IsValid)
         {
             _commandBus.Send(command);
             return successFunc();
         }
         else if(validationFailFunc.IsNotNull())
         {
             return validationFailFunc();
         }
     }
     else if (preConditionResult.IsNotNull())
     {
         return preConditionResult();
     }
     return failFunc();
 }