public string GetTemplateLink(string repositoryId, string type, IDictionary <string, object> parameters) { string template = (string)templateCache.Get(new string[] { repositoryId, type }); if (template == null) { return(null); } StringBuilder result = new StringBuilder(); StringBuilder param = new StringBuilder(); bool paramMode = false; for (int i = 0; i < template.Length; i++) { char c = template[i]; if (paramMode) { if (c == '}') { paramMode = false; object paramValue; if (parameters.TryGetValue(param.ToString(), out paramValue)) { result.Append(paramValue == null ? "" : Uri.EscapeDataString(UrlBuilder.NormalizeParameter(paramValue))); } param = new StringBuilder(); } else { param.Append(c); } } else { if (c == '{') { paramMode = true; } else { result.Append(c); } } } return(result.ToString()); }
public string GetRepositoryLink(string repositoryId, string rel) { return((string)repositoryLinkCache.Get(new string[] { repositoryId, rel })); }
public string GetCollection(string repositoryId, string collection) { return((string)collectionLinkCache.Get(new string[] { repositoryId, collection })); }
public string GetTypeLink(string repositoryId, string id, string rel, string type) { return((string)typeLinkCache.Get(new string[] { repositoryId, id, rel, type })); }
public ITypeDefinition Get(string repositoryId, string typeId) { return((ITypeDefinition)cache.Get(new string[] { repositoryId, typeId })); }
public IRepositoryInfo Get(string repositoryId) { return((IRepositoryInfo)cache.Get(new string[] { repositoryId })); }