private static string GetUrl <T>(RiseBase riseBase) { var type = riseBase.GetType(); UrlAttribute urlAttribute = ( UrlAttribute )Attribute.GetCustomAttribute(type, typeof(UrlAttribute)); if (urlAttribute == null || string.IsNullOrWhiteSpace(urlAttribute.UrlValue)) { throw new Exception($"Resource for {type.Name} does not have defined url."); } return($"{Constants.URL_BASE}/{urlAttribute.UrlValue}/{riseBase.Id}/{GetUrlForType<T>()}"); }
private static string GetUrl <T>(RiseBase riseBase, string childId) { return($"{GetUrl<T>( riseBase )}/{childId}"); }
internal static void Delete <T>(RiseBase riseBase, string childId) { var resource = GetUrl <T>(riseBase, childId); ApiDelete(resource); }
internal static void Put <T>(RiseBase riseBase, string childId) { var resource = GetUrl <T>(riseBase, childId); ApiPut(resource); }
internal static IEnumerable <T> GetSet <T>(RiseBase riseObject, Dictionary <string, string> parameters = null) { return(GetPagenatedResource <T>(GetUrl <T>(riseObject), parameters)); }