예제 #1
0
        public TR FindSingleAs <TR>(object id) where TR : class
        {
            int intId = (int)id;
            Expression <Func <T, TR> > exp = QueryMapper.GetExpression <T, TR>();

            return(Loader.Where(d => d.Id == intId).Select(exp).FirstOrDefault());
        }
예제 #2
0
        public TR FindSingleAs <TR>(Expression <Func <T, bool> > expression) where TR : class
        {
            Expression <Func <T, TR> > exp = QueryMapper.GetExpression <T, TR>();

            return(Loader.Where(expression).Select(exp).FirstOrDefault());
        }