so much effort ent into this another day the cleaning will be done and the support of regular selects.
This commit is contained in:
		
							parent
							
								
									ba702d3e81
								
							
						
					
					
						commit
						0540554877
					
				@ -6,6 +6,7 @@ using System.Text;
 | 
				
			|||||||
using System.Threading.Tasks;
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
using PoweredSoft.DynamicLinq;
 | 
					using PoweredSoft.DynamicLinq;
 | 
				
			||||||
using PoweredSoft.DynamicLinq.Dal;
 | 
					using PoweredSoft.DynamicLinq.Dal;
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace PoweredSoft.DynamicLinq.Test
 | 
					namespace PoweredSoft.DynamicLinq.Test
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@ -83,13 +84,14 @@ namespace PoweredSoft.DynamicLinq.Test
 | 
				
			|||||||
                    Count = t.Count(),
 | 
					                    Count = t.Count(),
 | 
				
			||||||
                });*/
 | 
					                });*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            /*
 | 
				
			||||||
            TestData.Sales.GroupBy(t => new { t.ClientId }).Select(t => new
 | 
					            TestData.Sales.GroupBy(t => new { t.ClientId }).Select(t => new
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                TheClientId = t.Key.ClientId,
 | 
					                TheClientId = t.Key.ClientId,
 | 
				
			||||||
                Count = t.Count(),
 | 
					                Count = t.Count(),
 | 
				
			||||||
                LongCount = t.LongCount(),
 | 
					                LongCount = t.LongCount(),
 | 
				
			||||||
                TaxAverage = t.Average(t2 => t2.Tax)
 | 
					                TaxAverage = t.Average(t2 => t2.Tax)
 | 
				
			||||||
            });
 | 
					            });*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var dynamicSyntax2 = TestData.Sales
 | 
					            var dynamicSyntax2 = TestData.Sales
 | 
				
			||||||
               .AsQueryable()
 | 
					               .AsQueryable()
 | 
				
			||||||
@ -101,9 +103,10 @@ namespace PoweredSoft.DynamicLinq.Test
 | 
				
			|||||||
                    t.LongCount("LongCount");
 | 
					                    t.LongCount("LongCount");
 | 
				
			||||||
                    t.Sum("NetSales");
 | 
					                    t.Sum("NetSales");
 | 
				
			||||||
                    t.Average("Tax", "TaxAverage");
 | 
					                    t.Average("Tax", "TaxAverage");
 | 
				
			||||||
                    //t.ToList("Sales");
 | 
					                    t.ToList("Sales");
 | 
				
			||||||
               });
 | 
					               });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var result = dynamicSyntax2.ToObjectList();
 | 
					            var result = dynamicSyntax2.ToObjectList();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
@ -181,6 +181,12 @@ namespace PoweredSoft.DynamicLinq.Helpers
 | 
				
			|||||||
                var body = Expression.Call(typeof(Enumerable), "Sum", new[] { notGroupedType }, parameter, innerMemberLambda);
 | 
					                var body = Expression.Call(typeof(Enumerable), "Sum", new[] { notGroupedType }, parameter, innerMemberLambda);
 | 
				
			||||||
                return body;
 | 
					                return body;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            else if (selectType == SelectTypes.ToList)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                var notGroupedType = parameter.Type.GenericTypeArguments[1];
 | 
				
			||||||
 | 
					                var body = Expression.Call(typeof(Enumerable), "ToList", new[] { notGroupedType }, parameter);
 | 
				
			||||||
 | 
					                return body;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            throw new NotSupportedException($"unkown select type {selectType}");
 | 
					            throw new NotSupportedException($"unkown select type {selectType}");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user