private static string NormalizeId(string id, string resourceName, string resourceValue)
{
int startIndex = id.IndexOf(resourceName, StringComparison.OrdinalIgnoreCase) + resourceName.Length + 1;
int endIndex = id.IndexOf("/", startIndex, StringComparison.OrdinalIgnoreCase);
// Replace the following string '/{value}/'
startIndex--;
string orignalString = id.Substring(startIndex, endIndex - startIndex + 1);
return id.Replace(orignalString, string.Format("/{0}/", resourceValue));
}