Skip to content

Instantly share code, notes, and snippets.

@wsrzx
Last active September 1, 2020 11:57
Show Gist options
  • Save wsrzx/31385519895f0d1c7f88595c9bfef100 to your computer and use it in GitHub Desktop.
Save wsrzx/31385519895f0d1c7f88595c9bfef100 to your computer and use it in GitHub Desktop.
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