c# - Entityframework 4.0 .CreateQuery<T> and OrderBy exception -
I thought it was fixed in 4.0. I have this method public IQueryable & lt; T & gt; All (expression & lt; funk & lt; t, object & gt; & gt; sort) {EntityContext.Creatate & quot; T & gt; (EntityName). Eskenable & lt; T & gt; (). Respectively (sort); } Unable to type 'System.Object' for the following throws an exception type 'System.Int32'. LINQ only supports entity-type model model primitive type casting for units. Source System.Data.Entity Any ideas how to fix or if it is no way it happens with every call, while the Order string is not datatype IQueryable & LT; Blog & gt; All sorted = _pozitory.all (x = & gt; x.Title); Since the title is a string by which the order works fine. But it fails with any other datatypes Since I had come up with the "bad" solution before the mark I thought I would post it public IQueryable & lt; T & gt; All (expression & lt; funk & lt; t, obje...