示例#1
0
        public IList <TEntity> Matching <TSearchInput>(TSearchInput criteria)
        {
            IBaseQueryObject <TEntity> query = _manager.GetQueryBySearchCriteria <TEntity, TSearchInput>();

            query.SearchInputObject = criteria;

            return(Matching(query));
        }
示例#2
0
        IList <TEntity> Matching(IBaseQueryObject <TEntity> query)
        {
            IList <TEntity> results = query.Execute();

            ApplyDomainObjectSettings(ref results, query);

            return(results);
        }
示例#3
0
        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);
            });
        }
示例#4
0
        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);
        }
示例#5
0
 public void SetQueryObject(IBaseQueryObject queryObject)
 {
     _queryObject = queryObject;
 }