I've used a converter to change vb to c# and one of the lines originally is:
Dim roles = System.Web.Security.Roles.GetAllRoles()
Dim roleNames() As String = roles.Where(Function(x) x.ToLower() <> "Admin").ToArray()
When the conversion returns I get:
dynamic roles = System.Web.Security.Roles.GetAllRoles();
string[] roleNames = roles.Where(x => x.ToLower() != "Admin").ToArray();
Which then throws the error:
Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type.
I've tried a few different ways and a few different converters, but I dont get any different results.
Why does it work fine in vb and not in c# if the conversion is correct?