private static string CountExpression <TReportModel, TOut>(Expression <Func <TReportModel, TOut> > expression, string formatString) { var sum = string.Format("Count(Fields.{0})", MemberAccessPathBuilder.GetPath(expression)); return(string.IsNullOrWhiteSpace(formatString) ? string.Format("={0}", sum) : _Format(sum, formatString)); }
private static string BuildFieldBinding <TModel, TMember>(Expression <Func <TModel, TMember> > memberAccessExpression) { var path = MemberAccessPathBuilder.GetPath(memberAccessExpression); return(string.IsNullOrWhiteSpace(path) ? "Empty Path!" : string.Format("=Fields.{0}", path)); }
private static string _Format <TIn, TOut>(Expression <Func <TIn, TOut> > memberAccessExpression, string formatString, bool partial = false) { return(_Format(MemberAccessPathBuilder.GetPath(memberAccessExpression), formatString, partial)); }
public static void Bind <TReportModel, TReportItem, TBind>(this IEntityReport <TReportModel> report, TReportItem reportItem, Expression <Func <TReportItem, TBind> > member, Expression <Func <TReportModel, TBind> > value, string formatString = null) where TReportItem : ReportItemBase { reportItem.Bindings.Add(new Binding(MemberAccessPathBuilder.GetPath(member), Field(null, value, formatString))); }
public static string PartialField <TReportModel, TMember>(this IEntityReport <TReportModel> report, Expression <Func <TReportModel, TMember> > expression) { return(string.Format("Fields.{0}", MemberAccessPathBuilder.GetPath(expression))); }
public static TOutput ReadDataObjectProperty <TInput, TOutput>(object sender, Expression <Func <TInput, TOutput> > expression) where TOutput : class where TInput : class { return(ReadDataObjectProperty <TOutput>(sender, MemberAccessPathBuilder.GetPath(expression))); }