Beispiel #1
0
        private static void CalculateTransactionSupport()
        {
            TransactionSupportAttribute transactionSupport = ReflectionCache.GetCustomAttribute <TransactionSupportAttribute>(typeof(T), true);

            if (transactionSupport != null)
            {
                _transactionOptions = transactionSupport.TransactionOption;
            }
            else
            {
                _transactionOptions = TransactionOption.None;
            }
        }
Beispiel #2
0
        private static void CalculateExecutionType()
        {
            ActionExcutionOrderAttribute actionExecutionOrder = ReflectionCache.GetCustomAttribute <ActionExcutionOrderAttribute>(typeof(T), true);

            if (actionExecutionOrder != null)
            {
                _excutionType = actionExecutionOrder.ExcutionType;
            }
            else
            {
                _excutionType = ExcutionType.None;
            }

            //TargetTenantDataAttribute targetTenantDataNeeded = ReflectionCache.GetCustomAttribute<TargetTenantDataAttribute>(typeof(T), true);

            //if (targetTenantDataNeeded != null)
            //    fetchDataFromTarget = targetTenantDataNeeded.Fetch;
            //else
            //    fetchDataFromTarget = false;
        }
Beispiel #3
0
        private static void CalculateAuthorizationFields()
        {
            //1. Check for the presence of any of the Action attributes

            ActionDescriptorAttribute action = ReflectionCache.GetCustomAttribute <ActionDescriptorAttribute>(typeof(T), true);

            if (action == null)
            {
                action = ReflectionCache.GetCustomAttribute <CheckedActionDescriptorAttribute>(typeof(T), true);
            }

            if (action == null)
            {
                action = ReflectionCache.GetCustomAttribute <RecordedActionDescriptorAttribute>(typeof(T), true);
            }

            if (action == null)
            {
                action = ReflectionCache.GetCustomAttribute <CheckedAndRecordedActionDescriptorAttribute>(typeof(T), true);
            }

            //2. Read the attribute data
            if (action == null)
            {
                _needsAuthoriztion = false;
            }
            else
            {
                //TODO : Read the RecordAction
                _needsAuthoriztion = action.CheckAuthorization;
                if (_needsAuthoriztion)
                {
                    _actionToAuthorize = action.Name;
                }
            }
        }