SyntaxFix
Write A Post
Hire A Developer
Questions
You should convert the string to an enumeration value before comparing.
Enum.TryParse("Retailer", out AccountType accountType);
Then
if (userProfile?.AccountType == accountType) { //your code }