Пример #1
0
        public ServiceResult <VrstaPovrsine> Update(VrstaPovrsine vrstaPovrsine)
        {
            _vrstaPovrsineRepository.Update(vrstaPovrsine);

            _vrstaPovrsineRepository.SaveChanges();

            return(new ServiceResult <VrstaPovrsine>(true, "Vrsta povrsine uspesno izmenjena.", vrstaPovrsine));
        }
Пример #2
0
        public ServiceResult <VrstaPovrsine> Delete(VrstaPovrsine vrstaPovrsine)
        {
            _vrstaPovrsineRepository.Delete(vrstaPovrsine);

            _vrstaPovrsineRepository.SaveChanges();

            return(new ServiceResult <VrstaPovrsine>(true, "Vrsta povrsine uspesno izbrisana."));
        }
Пример #3
0
        public ServiceResult <VrstaPovrsine> Add(VrstaPovrsine vrstaPovrsine)
        {
            _vrstaPovrsineRepository.Add(vrstaPovrsine);

            _vrstaPovrsineRepository.SaveChanges();

            return(new ServiceResult <VrstaPovrsine>(true, "Vrsta povrsine uspesno dodata.", vrstaPovrsine));
        }
Пример #4
0
        public IActionResult Post([FromBody] VrstaPovrsine vrstaPovrsine)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var result = _vrstaPovrsineService.Add(vrstaPovrsine);

            if (result.Success)
            {
                return(Ok(result));
            }

            return(BadRequest(result));
        }