Exemplo n.º 1
0
        public void Add(SchoolTypeDto schoolTypeDto)
        {
            var schoolType = new SchoolType()
            {
                Name = schoolTypeDto.Name
            };

            _schoolTypeRepository.Add(schoolType);
        }
Exemplo n.º 2
0
        public void Update(short Id, SchoolTypeDto model)
        {
            var schoolType = _schoolTypeRepository.GetById(Id);

            if (schoolType != null)
            {
                schoolType.Name = model.Name;

                _schoolTypeRepository.Update(schoolType);
            }
        }
Exemplo n.º 3
0
        public static SchoolTypeDto Mapper(this SchoolType schoolType)
        {
            var dto = new SchoolTypeDto();

            if (schoolType != null)
            {
                dto.Id   = schoolType.Id;
                dto.Name = schoolType.Name;
            }

            return(dto);
        }
Exemplo n.º 4
0
        public IActionResult Put(short Id, [FromBody] SchoolTypeDto value)
        {
            _schoolTypeService.Update(Id, value);

            return(Ok());
        }
Exemplo n.º 5
0
        public IActionResult Post([FromBody] SchoolTypeDto value)
        {
            _schoolTypeService.Add(value);

            return(Ok());
        }