Suppose I have a database of Khans. I can use this entity framework code to fetch a khan by name
Khan khan=context.Khans.Where(x=>x.Name.Contains("Öge")).Single();
The problem is that in practice users will type "Oge" instead of "Öge" and won't get any matches. Is there an easy way to deal with this so that letters with accent marks always count as letters without accents for searches?
I found this SO question that has a solution for the Compare
method but I can't seem to use this for a database query:
string.Compare(s1, s2, CultureInfo.CurrentCulture, CompareOptions.IgnoreNonSpace);