private static Expression <Func <TResult> > getValueExpression( IReadScalar <INotifyCollectionChanged> sourceScalar) { Expression <Func <TSourceItem> > summarizingExpression = () => sourceScalar.Summarizing <TSourceItem>().Value; Expression <Func <int> > countExpression = () => sourceScalar.Value != null ? ((IList)sourceScalar.Value).Count : 0; return(getExpression(summarizingExpression, countExpression)); }