예제 #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)));
        }