Example #1
0
        public async Task <HttpResponseMessage> History([FromUri] FileHistoryRequest request)
        {
            IResultServiceModel <FileHistoryResponse> response = new ResultServiceModel <FileHistoryResponse>();

            try
            {
                var rmCredentials = this.ValidateUserCredentials(request.userName);
                if (rmCredentials.Success)
                {
                    response = await this.mainService.GetFileHistoryAsync(request.userName, request.id);
                }
                else
                {
                    response.OnError(rmCredentials);
                }
            }
            catch (Exception ex)
            {
                response.OnException(ex);
            }

            string uri          = Url.Link("FileHistoryApi", new { id = request.id });
            var    httpResponse = Request.CreateResponse <IResultServiceModel <FileHistoryResponse> >(HttpStatusCode.Created, response);

            httpResponse.Headers.Location = new Uri(uri);

            return(httpResponse);
        }
        public async override Task <FileHistoryReply> GetFileHistory(FileHistoryRequest request, ServerCallContext context)
        {
            Guid parsed;
            var  reply = new FileHistoryReply {
            };

            if (Guid.TryParse(request.Id, out parsed))
            {
            }
            return(await Task.FromResult(reply));
        }