I solved the problem. Actually the problem was I didn’t have a using
directive to System.Data.Entity
namespace at the top of my class.
Even thought I could use "Include("PropertyName)"
name in my query, I couldn’t use "Include(x=> x.Childs)"
. But after adding "using System.Data.Entity"
on top of my class I can use "Include"
in these both ways on a query and my error is solved.
0
solved Why do I get Argument exception when I try to use “Include(“PropertyName”)” in query EF?