public void AddTest() { schoolService.Add(new School() { Name = "TestSchool" }); Assert.AreEqual(1, schoolRepository.schools.Count); }
public IActionResult InsertSchool([FromBody] School school) { var data = _schoolService.Add(school); if (data.Success) { return(Ok(data)); } return(BadRequest(data.Message)); }
public SchoolDto Add(SchoolDto subject) { return(schoolService.Add(subject)); }
public async Task <ActionResult <SchoolDto> > Post([FromBody] SchoolInputDto input) { var school = await _schoolService.Add(input); return(CreatedAtAction(nameof(Get), new { id = school.SchoolId }, school)); }