Пример #1
0
 public void AddTest()
 {
     schoolService.Add(new School()
     {
         Name = "TestSchool"
     });
     Assert.AreEqual(1, schoolRepository.schools.Count);
 }
Пример #2
0
        public IActionResult InsertSchool([FromBody] School school)
        {
            var data = _schoolService.Add(school);

            if (data.Success)
            {
                return(Ok(data));
            }
            return(BadRequest(data.Message));
        }
Пример #3
0
 public SchoolDto Add(SchoolDto subject)
 {
     return(schoolService.Add(subject));
 }
Пример #4
0
            public async Task <ActionResult <SchoolDto> > Post([FromBody] SchoolInputDto input)
            {
                var school = await _schoolService.Add(input);

                return(CreatedAtAction(nameof(Get), new { id = school.SchoolId }, school));
            }