public async Task <IActionResult> PostSchool([FromBody] School school) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } await _SchoolService.AddAsync(school); return(CreatedAtAction("GetSchool", new { id = school.Id }, school)); }
public async Task <ActionResult <School> > AddAsync([FromBody] School schoolAdmin) { var item = await _schoolService.AddAsync(schoolAdmin); return(CreatedAtAction(nameof(GetByIdAsync), new { id = item.Id }, item)); }