none
Is there a way to query a property on Type using System.Linq.Dynamic

    Question

  • I have a class "A" and "B" and a class "D" and "C" that inherit "B" 

    in this post I found the code to implement an OfType extension method, but that does't work in my scenario. I need some thing along the lines of this: 

               IQueryable<A> result;
                result = dbModel.As.Where("AStuff.Contains(@0) OR AStuff.Contains(@1)","ac","bc");
                result = result.Where("Bs.OfType(\"TestClassLibrary.Model.D\").Any(DMatter.Contains(\"xy\"))");
    
    Is there a way to make this work in a dynamic fashion?

    Monday, January 13, 2014 3:47 PM

Answers

  • Hello,

    >>Is there a way to make this work in a dynamic fashion?

    Not everything is supported in Dynamic LINQ DLL, there are only a limited number of methods are supported. In the code of System.Linq.Dynamic.ExpressionParser, there is not OfType parsing implemented.

    Regards.

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by ksighem Tuesday, January 14, 2014 9:22 AM
    Tuesday, January 14, 2014 8:54 AM