Ejemplo n.º 1
0
        public async Task <IActionResult> PostDepartment([FromBody] Department department)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            await _context.Create(department);


            return(CreatedAtAction("GetDepartment", new { id = department.Id }, department));
        }
 public IActionResult Create([FromBody] Model.Department newDepartment)
 {
     return(StatusCode(StatusCodes.Status200OK, repo.Create(newDepartment)));
 }