Ejemplo n.º 1
0
        public ActionResult Get(string idFile, [FromServices] IFileOperations operations)
        {
            try
            {
                var result = operations.GetById(idFile);

                if (result == null)
                {
                    return(OkWithSuccess(result, System.Net.HttpStatusCode.NotFound));
                }

                return(OkWithSuccess(result));
            }
            catch (Exception ex)
            {
                return(BadRequest(new { Code = HttpContext.Response.StatusCode, Message = ex.Message }));
            }
        }