public static Uri AddName(this Uri uri, string name) { if (uri == null) { throw new ArgumentNullException("uri"); } if (!String.IsNullOrEmpty(name)) { return new Uri(uri.ToString() + "." + name); } else { return uri; } } }