public static string ExpandPaths(string name, ConfigurationCollection configuration)
{
var alias = configuration.Paths.PathList
.Where(path => name.StartsWith(path.Key, StringComparison.OrdinalIgnoreCase))
.Where(path => name.Length == path.Key.Length || name[path.Key.Length] == '/')
.FirstOrDefault();
if (alias == null)
return name;
return alias.Value + name.Substring(alias.Key.Length);
}