Hi,
Thanks for your report. I've never used it, but it seems that Dynamic
Linq creates lambda expressions with parameters that have empty names,
which is very strange. Could you please check that this is really the
case? Just dump out the expression tree generated by DynamicLinq using
ToString() and post it here, please.
If this is indeed the reason for the exception, I'd ask you to create
a query parser integration test exhibiting the problem. You can use
Remotion.Linq.UnitTests.Linq.Core.Parsing.Structure.QueryParserIntegrationTests.VBSpecificQueryParserIntegrationTest
as a template.
As an additional question, why are you using the LinqToSqlAdapter
(instead of Microsoft's LinqToSql)? The LinqToSqlAdapter is meant only
as an example implementation of a LINQ provider based on re-linq's SQL
backend. I'm just saying this so that you know it's probably not
feature complete.
Thanks, best regards,
Fabian
On Thu, Oct 11, 2012 at 5:06 AM, 李永京 <
leeyo...@gmail.com> wrote:
> I used Dynamic
> Linq(
http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx
> ) in LinqToSqlAdapter,
> example:
> var result = Db.Customers
> .Where("UnitPrice> @0", 10m)
> .GroupBy("new (it.CategoryID)", "it")
> .Select("new (Key as GroupKey, Max(UnitPrice) as
> MaxPrice)");
>
> and throw a Exception: associatedIdentifier is null;
>
> in ExpressionTreeParser.cs find Method:
>
> private IExpressionNode ParseNode (Expression expression, string
> associatedIdentifier)
> {
> if (associatedIdentifier == null)
> associatedIdentifier = _identifierGenerator.GetUniqueIdentifier
> ("<generated>_");
>
> var methodCallExpression = GetQueryOperatorExpression(expression);
> if (methodCallExpression != null)
> return ParseMethodCallExpression (methodCallExpression,
> associatedIdentifier);
> else
> return ParseNonQueryOperatorExpression(expression,
> associatedIdentifier);
> }
>
> instead of" if (string.IsNullOrEmpty(associatedIdentifier))" fix it
>
> --
> You received this message because you are subscribed to the Google Groups
> "re-motion Users" group.
> To view this discussion on the web visit
>
https://groups.google.com/d/msg/re-motion-users/-/EtUy2Afxm1EJ.
> To post to this group, send email to
re-moti...@googlegroups.com.
> To unsubscribe from this group, send email to
>
re-motion-use...@googlegroups.com.
> For more options, visit this group at
>
http://groups.google.com/group/re-motion-users?hl=en.