I believe these 2 lines are equivalent but after running into a strange issue I no longer believe this to be the case.
String mimeType = context.Request.ContentType;
(String.Compare("text/xml", mimeType, true) == 0))
is the same as :
context.Request.ContentType.ToLower().Equals("text/xml")
Are their implementations in the CLR any different?
They are not completely equivalent; see here.
Here is the correct way to do a case insensitive comparison:
This way will also be more efficient becasue it doesn’t allocate a separate string for the lowercase copy.