This question already has an answer here:
I need to build Expression Tree for query:
con.Flats.Where(q => q.Street.Title.StartsWith(val, true, new CultureInfo("ru-RU")));
I try getting to StartsWith
method using this:
MethodInfo startsMethod = typeof(string).GetMethod("StartsWith", new Type[] { typeof(string), typeof(bool), typeof(CultureInfo) });
I get error:
LINQ to Entities does not recognize the method 'Boolean StartsWith(System.String, Boolean, System.Globalization.CultureInfo)' method, and this method cannot be translated into a store expression.
How do I do it properly?
Aucun commentaire:
Enregistrer un commentaire