public List <TReturn> ToList <TReturn>(Expression <Func <ISelectGroupingAggregate <TKey, TValue>, TReturn> > select) { var map = new ReadAnonymousTypeInfo(); var field = new StringBuilder(); var index = 0; _comonExp.ReadAnonymousField(null, field, map, ref index, select, getSelectGroupingMapString, null, true); if (map.Childs.Any() == false && map.MapType == null) { map.MapType = typeof(TReturn); } var method = _select.GetType().GetMethod("ToListMapReader", BindingFlags.Instance | BindingFlags.NonPublic); method = method.MakeGenericMethod(typeof(TReturn)); return(method.Invoke(_select, new object[] { new ReadAnonymousTypeAfInfo(map, field.Length > 0 ? field.Remove(0, 2).ToString() : null) }) as List <TReturn>); }
public object InternalToList(Expression select, Type elementType) { var map = new ReadAnonymousTypeInfo(); var field = new StringBuilder(); var index = 0; _comonExp.ReadAnonymousField(null, field, map, ref index, select, null, this, null, null, false); if (map.Childs.Any() == false && map.MapType == null) { map.MapType = elementType; } var method = _select.GetType().GetMethod("ToListMapReader", BindingFlags.Instance | BindingFlags.NonPublic); method = method.MakeGenericMethod(elementType); return(method.Invoke(_select, new object[] { new ReadAnonymousTypeAfInfo(map, field.Length > 0 ? field.Remove(0, 2).ToString() : null) })); }
public SelectedQueryProvider(Select0Provider select, Expression selector) { _select = select; _comonExp = _select._commonExpression; _map = new ReadAnonymousTypeInfo(); var field = new StringBuilder(); var index = -10000; //临时规则,不返回 as1 if (selector != null) { _comonExp.ReadAnonymousField(_select._tables, field, _map, ref index, selector, null, null, _select._whereGlobalFilter, null, false); //不走 DTO 映射,不处理 IncludeMany } _field = field.ToString(); }