示例#1
0
        public async Task <bool> Can <T>(Func <T, object> del) where T : IPolicy
        {
            var policy = GetPolicy <T>();
            var before = await policy.Before();

            if (before != null)
            {
                return((bool)before);
            }
            return(await Utils.ExtractRefTask <bool>(del(policy)));
        }
示例#2
0
 public async Task <IQueryable <TQueriable> > ScopeAsync <TPolicy, TQueriable>(params object[] args) where TPolicy : IPolicy
 {
     return(await Utils.ExtractRefTask <IQueryable <TQueriable> >(
                Utils.CallMethod(GetPolicyOrRaise <TPolicy>(), "ScopeAsync", args)
                ));
 }