Пример #1
0
        public async Task <IActionResult> Get(Guid id)
        {
            OperationModel operation = null;

            try
            {
                operation = await _operationsClient.Get(id);
            }
            catch (HttpOperationException e)
            {
                if (e.Response.StatusCode == HttpStatusCode.NotFound)
                {
                    return(NotFound());
                }

                throw;
            }

            if (operation == null)
            {
                return(NotFound());
            }

            return(Ok(operation.ToApiModel()));
        }
Пример #2
0
 public static OperationModel ToApiModel(this Lykke.Service.Operations.Contracts.OperationModel src)
 {
     return(new OperationModel
     {
         Created = src.Created,
         Id = src.Id,
         Status = src.Status,
         Type = src.Type
     });
 }