示例#1
0
        public static async Task <T> GetItemFromController <T>(string controllerName, int id, ClaimsPrincipal user)
        {
            try
            {
                var client = new BaseApiClient(controllerName + "/", user);
                var ret    = await client.Get <T>(id);

                return(ret);
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#2
0
        public static async Task <IEnumerable <T> > GetFilteredEnumerableFromControllerAction <T>(string controllerName, string controlerAction, int id, ClaimsPrincipal user)
        {
            try
            {
                var client  = new BaseApiClient(controllerName + "/" + controlerAction + "/", user);
                var retList = await client.Get <IEnumerable <T> >(id);

                return(retList);
            }
            catch (Exception)
            {
                throw;
            }
        }