Пример #1
0
        public ActionResult Add([FromBody] MovieGenreDto dto)
        {
            var entity = MovieGenreFactory.ParsingDto(dto);

            _repository.Save(entity);
            return(new JsonResult(ResponseDmo.Success(MovieGenreFactory.ShowMovieGenre(entity), HttpStatusCode.Created)));
        }
Пример #2
0
        public ActionResult Detail(int id)
        {
            var data = _repository.FindById(id);

            if (data != null)
            {
                return(new JsonResult(ResponseDmo.Success(MovieGenreFactory.ShowMovieGenre(data))));
            }
            return(NotFound());
        }
Пример #3
0
        public ActionResult <MovieGenreDmo> GetMovieGenre()
        {
            var data = _repository.GetAll();

            return(new JsonResult(ResponseDmo.Success(data)));
        }