From 019d34bf0131303cc611eb4c1a70df6ddcc6c159 Mon Sep 17 00:00:00 2001 From: David Lebee Date: Fri, 19 Oct 2018 16:22:37 -0500 Subject: [PATCH] allows to specify the type instead. --- .../Fluent/Select/SelectBuilder.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/PoweredSoft.DynamicLinq/Fluent/Select/SelectBuilder.cs b/PoweredSoft.DynamicLinq/Fluent/Select/SelectBuilder.cs index 3d3387e..6f7a780 100644 --- a/PoweredSoft.DynamicLinq/Fluent/Select/SelectBuilder.cs +++ b/PoweredSoft.DynamicLinq/Fluent/Select/SelectBuilder.cs @@ -59,6 +59,23 @@ namespace PoweredSoft.DynamicLinq.Fluent return this; } + public SelectBuilder Aggregate(string path, SelectTypes type, string propertyName = null) + { + if (propertyName == null) + propertyName = path.Split('.').LastOrDefault(); + + ThrowIfUsedOrEmpty(propertyName); + + Parts.Add(new SelectPart + { + Path = path, + PropertyName = propertyName, + SelectType = type + }); + + return this; + } + public SelectBuilder Path(string path, string propertyName = null) { if (propertyName == null)