I couldn't realize

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
maxcpr
Posts: 33
Joined: Wed 10 Dec 2008 14:46

I couldn't realize

Post by maxcpr » Thu 01 Jul 2010 14:26

Hi guys i am really couldn't realize why there is no way to get SQL request from DataContext if i only know ExpressionTree that describe this request!!!

Please somebody who understand or guess why it so give me suggestion.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Mon 05 Jul 2010 14:34

Try the following code. expr is an Expression instance, context is a DataContext instance.

Code: Select all

      var query = Expression.Lambda(expr).Compile().DynamicInvoke();
      string s = context.GetCommand((IQueryable)query).CommandText;

Post Reply