コード例 #1
0
        public ActionResult <ApiResponse <Employee> > Add([FromBody] Employee employee)
        {
            if (employeeManager.CheckIfEmployeeExists(employee.Name))
            {
                return(this.BadRequest($"Employee with name {employee.Name} Already Exists"));
            }
            var response = employeeManager.AddEmployee(employee);

            return(response.ToApiResponse());
        }