Пример #1
0
        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));
        }
Пример #2
0
        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));
        }
Пример #3
0
 private static string _Format <TIn, TOut>(Expression <Func <TIn, TOut> > memberAccessExpression, string formatString, bool partial = false)
 {
     return(_Format(MemberAccessPathBuilder.GetPath(memberAccessExpression), formatString, partial));
 }
Пример #4
0
 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)));
 }
Пример #5
0
 public static string PartialField <TReportModel, TMember>(this IEntityReport <TReportModel> report, Expression <Func <TReportModel, TMember> > expression)
 {
     return(string.Format("Fields.{0}", MemberAccessPathBuilder.GetPath(expression)));
 }
Пример #6
0
 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)));
 }