Beispiel #1
0
        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>()}");
        }
Beispiel #2
0
 private static string GetUrl <T>(RiseBase riseBase, string childId)
 {
     return($"{GetUrl<T>( riseBase )}/{childId}");
 }
Beispiel #3
0
        internal static void Delete <T>(RiseBase riseBase, string childId)
        {
            var resource = GetUrl <T>(riseBase, childId);

            ApiDelete(resource);
        }
Beispiel #4
0
        internal static void Put <T>(RiseBase riseBase, string childId)
        {
            var resource = GetUrl <T>(riseBase, childId);

            ApiPut(resource);
        }
Beispiel #5
0
 internal static IEnumerable <T> GetSet <T>(RiseBase riseObject, Dictionary <string, string> parameters = null)
 {
     return(GetPagenatedResource <T>(GetUrl <T>(riseObject), parameters));
 }