示例#1
0
        public async Task <IActionResult> GetTaskAsync(int id)
        {
            Logger?.LogDebug("'{0} has been invoked", nameof(GetTaskAsync));

            var response = new SingleResponse <Task>();

            try
            {
                response.Model = await DbContext.GetTaskAsync(new Task(id));
            }
            catch (Exception ex)
            {
                response.DidError     = true;
                response.ErrorMessage = "There was an internal error, please contact to technical support";

                Logger?.LogCritical("There was an error on '{0}' invocation: {1}", nameof(GetTaskAsync), ex);
            }

            return(response.ToHttpResponse());
        }