Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Methods on type are not accessible error #46

Closed
jotab123 opened this issue Sep 21, 2016 · 3 comments
Closed

Methods on type are not accessible error #46

jotab123 opened this issue Sep 21, 2016 · 3 comments

Comments

@jotab123
Copy link
Contributor

jotab123 commented Sep 21, 2016

Trying to call a method in Where clause returns an error: "Methods on type 'SampleModel' are not accessible"

If you add a method to your SampleModel test class:

public class SampleModel 
{
     //.....
     public bool TestMethod(SampleModel other)
     {
          return true;
     }
}

This test should fail:

var testUsers = User.GenerateSampleModels(100).AsQueryable();
var testUsers2 = User.GenerateSampleModels(100).ToArray();

var results = testUsers.Where("TestMethod(@0)", testUsers2);

EntityFramework 1.0.1
Linq Dynamic Core 1.0.6.1

@StefH
Copy link
Collaborator

StefH commented Sep 24, 2016

Fixed with your PR #47 ?

@jotab123
Copy link
Contributor Author

Yes!

@fredrikkronander
Copy link

Hi,
I'm trying to use dynamic expressions that uses methods on the entities, in this case the User entity has a public method to get "RelatedUsers" but it fails with the message "Methods on type "UserEntity" are not accessible". Shouldn't that kind of call be possible now?

var employees = user.ToQueryable().Select("RelatedUsers(\"Employees\")").ToDynamicList();

Thanks!
Regards
Fredrik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants