public IList <TEntity> Matching <TSearchInput>(TSearchInput criteria) { IBaseQueryObject <TEntity> query = _manager.GetQueryBySearchCriteria <TEntity, TSearchInput>(); query.SearchInputObject = criteria; return(Matching(query)); }
IList <TEntity> Matching(IBaseQueryObject <TEntity> query) { IList <TEntity> results = query.Execute(); ApplyDomainObjectSettings(ref results, query); return(results); }
void ApplyDomainObjectSettings(ref IList <TEntity> newResult, IBaseQueryObject query) { if ((newResult == null) || (!newResult.Any())) { return; } IBaseMapper <TEntity> mapper = DataSynchronizationManager.GetInstance().GetMapper <TEntity>(); ((List <TEntity>)newResult).ForEach(entity => { ((ISystemManipulation)entity).SetQueryObject(query); ((ISystemManipulation)entity).SetMapper(mapper); }); }
IDictionary <string, IBaseQueryObject <TEntity> > ConvertQueryListToDictionary <TEntity>(IList <IBaseQueryObject <TEntity> > queryList) where TEntity : IDomainObject { IDictionary <string, IBaseQueryObject <TEntity> > queryDictionary = new Dictionary <string, IBaseQueryObject <TEntity> >(); if ((queryList == null) || (!queryList.Any())) { return(queryDictionary); } for (int index = 0; index < queryList.Count; index++) { IBaseQueryObject <TEntity> query = queryList[index]; if (query == null) { continue; } queryDictionary.Add(query.SearchInputType.FullName, query); } return(queryDictionary); }
public void SetQueryObject(IBaseQueryObject queryObject) { _queryObject = queryObject; }