This is for the intranet. When I search for the username it comes out with lower case.
When I search for the username within the table it never finds the username because it seems it needs to be capitalized as it is also capitalized in the table.
Is there a way to make this work to work on any case when searching the table using SingleOrDefault?
var userNamenew = userName.Split('\\')[1]; //this equals to 'namel'
//var userNamenew = "NameL"; //this work
var CurrentUser = employee.SingleOrDefault(x => x.UserName == userNamenew);