Пример #1
0
        public async Task <HttpResponseMessage> Put()
        {
            Request.RegisterForDispose((IDisposable)_graphManager);
            var token           = Request.Headers.Authorization.Parameter;
            var isAuthenticated = _authenticationService.ValidateToken(token, out string username);
            var time            = 3600;

            if (await isAuthenticated)
            {
                var graphData = _graphManager.GetDataForAverageStorePriceGraph(username, time);
                return(HelperClass.JsonHttpResponse(graphData));
            }
            else
            {
                return(new HttpResponseMessage(System.Net.HttpStatusCode.Unauthorized));
            }
        }