S
shapper
Hello,
I am creating a int value has follows:
int result = db.Posts.Where(p => p.IsPublished == true &&
CheckPostDate(s.CreatedAt).GetValueOrDefault(false) == true).Count();
I get the error:
Method 'System.Nullable`1[System.Boolean]
CheckPostDate(System.Nullable`1[System.DateTime])' has no supported
translation to SQL.
Can't I call a function I created in a Linq query?
How can I solve this problem?
Thanks,
Miguel
I am creating a int value has follows:
int result = db.Posts.Where(p => p.IsPublished == true &&
CheckPostDate(s.CreatedAt).GetValueOrDefault(false) == true).Count();
I get the error:
Method 'System.Nullable`1[System.Boolean]
CheckPostDate(System.Nullable`1[System.DateTime])' has no supported
translation to SQL.
Can't I call a function I created in a Linq query?
How can I solve this problem?
Thanks,
Miguel