Last active
September 1, 2020 11:57
-
-
Save wsrzx/31385519895f0d1c7f88595c9bfef100 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int Type | |
{ | |
get | |
{ | |
return Url switch | |
{ | |
string tw when tw.Contains("twitter", StringComparison.InvariantCultureIgnoreCase) => 1, | |
string fb when fb.Contains("facebook", StringComparison.InvariantCultureIgnoreCase) => 2, | |
string gh when gh.Contains("github", StringComparison.InvariantCultureIgnoreCase) => 3, | |
string lk when lk.Contains("linkedin", StringComparison.InvariantCultureIgnoreCase) => 4, | |
_ => 0, | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment