Example #1
0
        /// <summary>
        /// Create a new IDCHainDefinition of the <paramref name="myType"/> and the chain of attributes.
        /// </summary>
        /// <param name="myType"></param>
        /// <param name="myAttribute"></param>
        /// <returns></returns>
        public static IDChainDefinition Create(String myType, params String[] myAttribute)
        {
            var chain = new IDChainDefinition(myType + "." + myAttribute, new List <TypeReferenceDefinition>()
            {
                new TypeReferenceDefinition(myType, myType)
            });

            foreach (var attr in myAttribute)
            {
                chain.AddPart(new ChainPartTypeOrAttributeDefinition(attr));
            }

            return(chain);
        }
Example #2
0
        public override void Validate(GQLPluginManager myPluginManager, IGraphDB myGraphDB, SecurityToken mySecurityToken, Int64 myTransactionToken)
        {
            if (!myPluginManager.HasPlugin <IGQLAggregate>(FuncName))
            {
                throw new AggregateOrFunctionDoesNotExistException(FuncName);
            }

            Aggregate = myPluginManager.GetAndInitializePlugin <IGQLAggregate>(FuncName);

            if (Parameters.Count != 1)
            {
                throw new AggregateParameterCountMismatchException(FuncName, 1, Parameters.Count);
            }

            _Parameter = Parameters.FirstOrDefault() as IDChainDefinition;
            if (_Parameter == null)
            {
                throw new AggregateNotAllowedException(this.FuncName);
            }

            _Parameter.Validate(myPluginManager, myGraphDB, mySecurityToken, myTransactionToken, false);
        }