Beispiel #1
0
        public static async Task <List <T> > GetListFromController <T>(string controllerName, string controlerAction, ClaimsPrincipal user)
        {
            var client  = new BaseApiClient(controllerName + "/" + controlerAction + "/", user);
            var retList = await client.GetList <List <T> >();

            return(retList);
        }
Beispiel #2
0
        public static async Task <String> PutItemToController <T>(string controllerName, int id, T item, ClaimsPrincipal user)
        {
            try
            {
                var client = new BaseApiClient(controllerName + "/", user);
                var ret    = await client.Put(id, item);

                return(ret);
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #3
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;
            }
        }
Beispiel #4
0
        public static async Task <IQueryable <T> > GetQuerableFromController <T>(string controllerName, ClaimsPrincipal user)
        {
            try
            {
                var client  = new BaseApiClient(controllerName, user);
                var retList = await client.GetList <IQueryable <T> >();

                return(retList);
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #5
0
        public static async Task <List <T> > GetFilteredListFromControllerAction <T>(string controllerName, int id, ClaimsPrincipal user)
        {
            try
            {
                var client  = new BaseApiClient(controllerName + "/" + id.ToString(), user);
                var retList = await client.GetList <List <T> >();

                return(retList);
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #6
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;
            }
        }