public SelectBuilder PathToList(string path, string propertyName = null, SelectCollectionHandling selectCollectionHandling = SelectCollectionHandling.LeaveAsIs) { if (propertyName == null) { propertyName = path.Split('.').LastOrDefault(); } ThrowIfUsedOrEmpty(propertyName); Parts.Add(new SelectPart { Path = path, PropertyName = propertyName, SelectType = SelectTypes.PathToList, SelectCollectionHandling = selectCollectionHandling }); return(this); }
public SelectBuilder Aggregate(string path, SelectTypes type, string propertyName = null, SelectCollectionHandling selectCollectionHandling = SelectCollectionHandling.LeaveAsIs) { if (propertyName == null && path == null) { throw new Exception("if property name is not specified, a path must be supplied."); } if (propertyName == null) { propertyName = path.Split('.').LastOrDefault(); } ThrowIfUsedOrEmpty(propertyName); Parts.Add(new SelectPart { Path = path, PropertyName = propertyName, SelectType = type, SelectCollectionHandling = selectCollectionHandling }); return(this); }
public SelectBuilder LastOrDefault(string path, string propertyName = null, SelectCollectionHandling selectCollectionHandling = SelectCollectionHandling.LeaveAsIs) => Aggregate(path, SelectTypes.LastOrDefault, propertyName: propertyName, selectCollectionHandling: selectCollectionHandling);
public SelectBuilder PathToList(string path, string propertyName = null, SelectCollectionHandling selectCollectionHandling = SelectCollectionHandling.LeaveAsIs) => ToList(path, propertyName, selectCollectionHandling);