Skip to content

Instantly share code, notes, and snippets.

@willbuildapps

willbuildapps/laziness.cs

Last active Sep 1, 2020
Embed
What would you like to do?
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