I have an issue where my entityframework model is not pulling though data from two columns of a sql server database table. It pulls through all the others but two integer columns are always zero regardless of what it says in the table.
here are my two statements.
statList = (from s in context.Stats where s.Make.ToUpper() == manufacturer.ToUpper() select s).ToList();
int i = (from d in context.Stats where d.StatID == 22 select d.ItemCount).FirstOrDefault();
The first statement obviously pulls through a list of entity objects, and this has the ItemCount and OptionCount columns set to zero for every object.
The second statement pulls through just the column I want for a specific record and it pulls out the correct value.....
What on earth is going on? I have never seen this happen before.
I have tried deleting the edmx file and recreating from scratch but it still does the same thing. I have checked the column mappings and they all look fine.