Why is ReSharper telling me that “User.Identity == null” will always be false?
问题 I have a simple property inside one of my ASP.NET MVC Controller classes. I've seen this many times before, so understand what the message means, but usually it makes perfect sense. This, however, doesn't. To get to the underlined statement, User would have to NOT be null, so the check for User.Identity is fine. The Identity property is part of the IPrincipal interface, and returns an object that inherits IIdentity. To inherit this interface, or any interface for that matter, this property