public JsonResult GetUpdated(Guid id)
{
var js = new JsonResult();
js.Data =
new
{
Record = (from p in _person.All
where p.PersonId == id
select new {
p.PersonId,
p.Username,
p.Firstname,
p.Lastname,
p.FavoriteNumber,
p.Country,
RowVersion = CustomStringFunctionHere(p.RowVersion ?? new byte[] { })
} ).Single()
};
return js;
}
string CustomStringFunctionHere(byte[] a)
{
return "AAA" + Convert.ToBase64String(a) + "BBB";
}
..Entity Framework does:
LINQ to Entities does not recognize the method 'System.String CustomStringFunctionHere(Byte[])' method, and this method cannot be translated into a store expression.
NHibernate do the projection differently, its select expression is not being translated to its store equivalent.
Michael Buen
ReplyDeleteIt looks like Kellerman Software has a MySQL LINQ Provider:
https://www.kellermansoftware.com/p-47-net-data-access-layer.aspx