What is the right string comparison value to be used in a machine to machine communication scenario?
问题 Consider a scenario where you are implementing code meant to be used for machine to machine communication. The typical example for that is the code executed inside a web API action method. Suppose that you want to perform an exact match between strings; maybe you have a list of users and you wan to find one specific user provided the user name: List<User> users = .... const string username = "user-123"; var user = users.Find(u => string.Equals(username, u.UserName)); In such a scneario should