Пример #1
0
        public async Task <TDestination> SingleAsync <TSource, TDestination>(Expression <Func <TSource, bool> > expression, bool include = false) where TSource : class where TDestination : class
        {
            try
            {
                GetProperties(expression);
                string uri = FormatUriWithIds <TSource>();
                token = await _jwt.CheckTokenAsync(token);

                return(await _http.GetAsync <TDestination>($"{uri}?include={include.ToString()}", "AdminClient", token.Token));
            }
            catch
            {
                throw;
            }
        }
Пример #2
0
        public async Task <TDestination> SingleAsync <TSource, TDestination>(Expression <Func <TSource, bool> > whereExpr, bool include = false)
            where TSource : class
            where TDestination : class
        {
            try
            {
                GetProperties(whereExpr);
                string uri = FormatUriWithIds <TSource>();
                _token = await _jwtTokenService.CheckTokenAsync(_token);

                return(await _http.GetAsync <TDestination>($"{uri}?include={include.ToString()}", AppConstants.HttpClientName, _token.Token));
            }
            catch (Exception ex)
            {
                throw;
            }
        }