var relations = ApplicationContext.Services.RelationService.GetByParentId(CurrentPage.Id).
but this does not
var relations = ApplicationContext.Services.RelationService.GetByParentId(CurrentPage.Id).Where(r => r.RelationTypeId = 2);
or maybe the slightly nicer:
var relations = ApplicationContext.Services.RelationService.GetByParentId(CurrentPage.Id).Where(r => r.RelationType.Alias = "x2y");
It does work in a C# class, but in a razor view the error I get is :
Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type
I have no idea at all what this means and google isn't really helping me. It just seems to be telling me that what I am trying to do is "bad" as apparently it couldn't be unit tested. I don't really understand, and would appreciate some guidance.
This is the whole error message:
Compiler Error Message: CS1977: Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type Source Error:
Line 3: @{
Line 4: Layout = null;
Line 5: var relations = ApplicationContext.Services.RelationService.GetByParentId(CurrentPage.Id).Where(r => r.RelationTypeId = 2);
using linq in razor view for the relation service
In this topic: /backoffice-extensions/nupickers/questionssuggestions/60250-How-does-relations-work
This works:
but this does not
or maybe the slightly nicer:
Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type
I have no idea at all what this means and google isn't really helping me. It just seems to be telling me that what I am trying to do is "bad" as apparently it couldn't be unit tested. I don't really understand, and would appreciate some guidance.
This is the whole error message:
Compiler Error Message: CS1977: Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type
Source Error:
Source File: c:\inetpub\v7test\Views\x.cshtml Line: 5
is working on a reply...