Ejemplo n.º 1
0
        /// <summary>
        /// Queries array of the specified return entity type.
        /// </summary>
        /// <param name="returnEntityType">Type of the return entity.</param>
        /// <param name="propertyName">Name of the property.</param>
        /// <param name="baseEntity">The base entity.</param>
        /// <returns>The query result.</returns>
        protected object Query(Type returnEntityType, string propertyName, Entity baseEntity)
        {
            if (onQuery != null)
            {
                EntityConfiguration   ec = baseEntity.GetEntityConfiguration();
                PropertyConfiguration pc = ec.GetPropertyConfiguration(propertyName);

                try
                {
                    return(onQuery(returnEntityType, propertyName, pc.QueryWhere, pc.QueryOrderBy, baseEntity));
                }
                catch
                {
                    onQuery = null;
                }
            }
            return(null);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Queries array of the specified return entity type.
        /// </summary>
        /// <param name="returnEntityType">Type of the return entity.</param>
        /// <param name="propertyName">Name of the property.</param>
        /// <param name="baseEntity">The base entity.</param>
        /// <returns>The query result.</returns>
        protected DynEntity[] Query(DynEntity returnEntityType, string propertyName, DynEntity baseEntity)
        {
            if (onQuery != null)
            {
                EntityConfiguration   ec = MetaDataManager.GetEntityConfiguration(baseEntity.EntityType.FullName);
                PropertyConfiguration pc = ec.GetPropertyConfiguration(propertyName);

                try
                {
                    return(onQuery(returnEntityType, propertyName, pc.QueryWhere, pc.QueryOrderBy, baseEntity));
                }
                catch (Exception ex)
                {
                    onQuery = null;
                    throw ex;
                }
            }
            return(null);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Set the actual query proxy handler binded to this entity.
 /// </summary>
 /// <param name="onQuery">The on query.</param>
 public void SetQueryProxy(QueryProxyHandler onQuery)
 {
     this.onQuery = onQuery;
 }