示例#1
0
        private string GetRelatedEntityPropertyName(QueryDynAttribute qa)
        {
            switch (qa.QueryType)
            {
            case QueryType.FkQuery:
                return(((FkQueryDynAttribute)qa).RelatedManyToOneQueryPropertyName);

            default:
                return(null);
            }
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DynQueryDescriber"/> class.
        /// </summary>
        /// <param name="qa">The query attribute instance.</param>
        /// <param name="qa">The property's property info.</param>
        /// <param name="pi">The entity type that the property returns.</param>
        /// <param name="entityType">The entity type.</param>
        public DynQueryDescriber(QueryDynAttribute qa, DynPropertyConfiguration pi, string propertyEntityType, string entityType)
        {
            this.qa = qa;

            //parse info from pi
            propertyName = pi.Name;

            relatedEntityPropertyName = GetRelatedEntityPropertyName(qa);

            entityPk = GetPkPropertyName(entityType);

            relatedEntityType             = propertyEntityType;
            relatedEntityPk               = GetPkPropertyName(propertyEntityType);
            relatedEntityPkEntityProperty = GetPkEntityProperty(propertyEntityType);
            relatedEntityPkType           = GetPkPropertyType(propertyEntityType);
        }
示例#3
0
        private Dictionary <string, string> GetRelationKeysMap(QueryDynAttribute qa)
        {
            switch (qa.QueryType)
            {
            case QueryType.ManyToManyQuery:
                return(GetRelationKeysMapFromRelationType(((ManyToManyQueryDynAttribute)qa).RelationType));

            case QueryType.CustomQuery:
                if (((CustomQueryDynAttribute)qa).RelationType != null)
                {
                    return(GetRelationKeysMapFromRelationType(((CustomQueryDynAttribute)qa).RelationType));
                }
                else
                {
                    return(null);
                }

            default:
                return(null);
            }
        }