/// <summary> /// 实体查询 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="queryRequest"></param> /// <returns></returns> public virtual T[] QueryEntity <T>(Bzure.Common.Data.EntityQueryRequest <T> queryRequest) where T : Bzure.Common.Core.IEntity, Bzure.Common.Core.IPersistenceState { lock (_queryHandlers) { InitEntityMap(typeof(T)); Delegate handler; if (_queryHandlers.TryGetValue(typeof(T), out handler)) { QueryEntityHandler <T> h = handler as QueryEntityHandler <T>; return(h(this, queryRequest)); } } return(default(T[])); }
void AppendEntityQueryHandler <T>(QueryEntityHandler <T> handler) where T : Bzure.Common.Core.IEntity { _queryHandlers[typeof(T)] = handler; }