I have a class called Person that has a method called hasPermission(Int 32)
I'm trying to call some linq and have tried various options but haven't managed to find a solution yet if anyone has any ideas, please can you help.
I currently have
IEnumerable<Person> co = this.Person();
//this.Person().Where(o => o.IsDeleted == false);
// src.Where(o => o.IsDeleted == false).Select(v => new { Text = v.Name });
return this.Json(co,JsonRequestBehavior.AllowGet);
you can see a couple of the other things i have tried in the comments.
Thanks for your help in advance
Gemma
Person
is a method that returns anIEnumerable<Person>
? According to its name, it probably isn't. ThePerson
method's signature would be helpful.hasPermission
here? You're looking for a solution, but don't clearly state the problem.this.Person().Where(p => p.HasPermission(2))
. Anyway, as long as you're operating on IQueryable everything must be translatable to SQL. That does not work with a common instance method.