I am using Entity Framework in my C# based code. I am running into an unexpected weirdness and am looking for suggestions.
Case 1, 2, 3, 4...
Projects:
RivWorks
For .Net Core just introduce;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using System.Linq;
using System.Data.Entity;
I was struggling with this in a Telerik Grid template within a Razor view for about an hour. In my case, this:
columns.Bound(x => x.ID).Template(@<text><a href="@(Model.AppUrl + AdditionalFeeTypes/Details/" + item.ID)">@item.ID</a></text>);
was supposed to be this:
columns.Bound(x => x.Id).Template(@<text><a href="@(Model.AppUrl + AdditionalFeeTypes/Details/" + item.Id)">@item.Id</a></text>);
The case on "Id" was wrong! I hope this helps someone. You might be getting this error just because you put a non-existent property!
I had a similar looking problem but with Rx and in my case adding
using System;
helped. FWIW
Mess with those extension methods missing is too annoying sometimes.
My issue involved the format:
.Columns(columns => {
columns.Bound(p => p.Id).Filterable(false);
columns.Bound(p => p.Name).Width(250);
...
Every p.Whatever had this error on it.
This was a project using MVC, and I found my issue was having "public static int" or "public static string" on these variables (Id, Name, etc.) in my model. When I removed "static" on all my model variables, I no longer got the error. Was driving me nuts for about a day...
i had the same problem with mvc 3 razor maybe someone has the same so i wanna show how to fix it in my stuation
List<Taksit> lst = db.Taksit.Where(y => y.OgrenciId.Equals(Convert.ToInt32( list[0].Id))).ToList();
i tried to use contains but hence OgrenciId is int i get the error mentioned here so by using equals the problem is solved