View gist:147f079cf7d69c55038d
This file contains 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 class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
Uri pageUri = new Uri("https://www.example.com/folder/page.aspx?query=1&sample=2#anchor"); | |
Uri simpleUri = new Uri("http://www.example.com/folder"); | |
Console.WriteLine("Uri Properties:"); | |
Console.WriteLine(); |
View gist:3859427
This file contains 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
private string ToCommaSeperatedString<T>(IEnumerable<T> items, Func<T, string> property) | |
{ | |
if (items != null && items.Count() > 0) | |
{ | |
List<string> values = new List<string>(); | |
foreach (T item in items) | |
{ | |
values.Add(property.Invoke(item)); | |
} |