Esempio n. 1
0
        public static Dictionary <OperationSymbol, OperationHelp> CachedOperationsHelp()
        {
            return(Operations.Value.GetOrAdd(GetCulture(), ci =>
            {
                var dic = Database.Query <OperationHelpEntity>().Where(n => n.Culture == ci.ToCultureInfoEntity()).ToDictionary(a => a.Operation);

                return OperationLogic.AllSymbols().ToDictionary(o => o, o => new OperationHelp(o, ci, dic.TryGetC(o)));
            }).Where(a => OperationLogic.OperationAllowed(a.Key, inUserInterface: true)).ToDictionary());
        }
Esempio n. 2
0
 public override string?IsAllowed()
 {
     return(OperationLogic.OperationAllowed(OperationSymbol, this.Type, inUserInterface: true) ? null :
            OperationMessage.Operation01IsNotAuthorized.NiceToString(this.OperationSymbol.NiceToString(), this.OperationSymbol.Key));
 }
Esempio n. 3
0
        public IEnumerable <OperationInfo> OperationInfos(Type entityType)
        {
            var result = operationInfoCache.GetOrAdd(entityType, OperationLogic.GetAllOperationInfos);

            return(result.Where(oi => OperationLogic.OperationAllowed(oi.OperationSymbol, entityType, true)));
        }