.razor file vs .cs file IsNullOrEmpty() usage differences
In a .cs file, you can call IsNullOrEmpty() directly on a string without any issue (StringVariable.IsNullOrEmpty()
). However, in a .razor file, you have to write String.IsNullOrEmpty(StringVariable)
in order to call the function. What is the cause of this difference? Why isn’t it standardized, considering both are in c# and the babies of Microsoft?