I am using LINQ to search through one of my Entity Framework tables and find a \"group\" based on the name. The name is a string and appears to be Unicode (says it is in the
Try name.Equals(gr.Name, StringComparison.OrdinalIgnoreCase)
If it works then the problem could be with gr.Name
.
--- Edit ---
I'm guessing that gr.Name
is not of type System.string
. (since String.Equals
gives you an error ==> from the previous post)
give this a shot
(gr.Name as string).Equals(name, StringComparison.OrdinalIgnoreCase)
or
String.Equals((gr.Name as string), name, StringComparison.OrdinalIgnoreCase)