示例#1
0
        /// <summary>
        /// Selects the specified "item" from the esper query.
        /// </summary>
        /// <typeparam name="T1">The type of the 1.</typeparam>
        /// <typeparam name="T2">The type of the 2.</typeparam>
        /// <param name="esperQuery">The esper query.</param>
        /// <param name="expression">The expression.</param>
        /// <returns></returns>
        public static DisposableObservableCollection <T2> Select <T1, T2>(this EsperQuery <T1> esperQuery, Expression <Func <T1, T2> > expression)
        {
            var transform = expression.Compile();

            esperQuery.Compile();
            if (typeof(T1) == typeof(T2))
            {
                return(esperQuery.Statement.AsObservableCollection <T2>(true));
            }

            return(new CascadeObservableCollection <T1, T2>(
                       esperQuery.Statement.AsObservableCollection <T1>(true),
                       transform,
                       true));
        }
示例#2
0
 /// <summary>
 /// Selects the specified "item" from the esper query.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="esperQuery">The esper query.</param>
 /// <returns></returns>
 public static DisposableObservableCollection <T> Select <T>(this EsperQuery <T> esperQuery)
 {
     esperQuery.Compile();
     return(esperQuery.Statement.AsObservableCollection <T>(true));
 }