Пример #1
0
        public async Task <IHttpActionResult> PutAsync(EmployeeRecord employee)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var updated = await _employeeProvider.UpdateAsync(employee);

                    if (updated != null)
                    {
                        return(Ok(updated));
                    }

                    return(NotFound());
                }

                return(BadRequest(ModelState));
            }
            catch (Exception e)
            {
                _logger.LogError("Error when putting employee", e);
                return(InternalServerError(e));
            }
        }