public IEnumerable <T> ExecuteCollection <T> (QueryModel queryModel)
        {
            ArgumentUtility.CheckNotNull("queryModel", queryModel);

            SqlCommandData commandData = GenerateSqlCommand(queryModel);
            var            projection  = commandData.GetInMemoryProjection <T> ().Compile();

            return(_resultRetriever.GetResults(projection, commandData.CommandText, commandData.Parameters));
        }
    public void GetInMemoryProjection_ConversionRequired ()
    {
      var body = Expression.Constant (0);
      var sqlCommandData = new SqlCommandData ("T", new CommandParameter[0], _rowParameter, body);

      var result = sqlCommandData.GetInMemoryProjection<object> ();

      var expectedExpression = Expression.Lambda<Func<IDatabaseResultRow, object>> (Expression.Convert (body, typeof (object)), _rowParameter);
      SqlExpressionTreeComparer.CheckAreEqualTrees (expectedExpression, result);
    }
        public void GetInMemoryProjection_ConversionRequired()
        {
            var body           = Expression.Constant(0);
            var sqlCommandData = new SqlCommandData("T", new CommandParameter[0], _rowParameter, body);

            var result = sqlCommandData.GetInMemoryProjection <object> ();

            var expectedExpression = Expression.Lambda <Func <IDatabaseResultRow, object> > (Expression.Convert(body, typeof(object)), _rowParameter);

            SqlExpressionTreeComparer.CheckAreEqualTrees(expectedExpression, result);
        }