public ActionResult Post([FromBody] GeneroInputModel Genero)
        {
            var result = _GeneroService.Post(Genero);

            return(new CreatedAtRouteResult("GetGenerosDetails",
                                            new { id = result.Id }, result));
        }
Example #2
0
        public GeneroViewModel Post(GeneroInputModel genero)
        {
            var generoAdd = _mapper.Map <Genero>(genero);

            _uow.GeneroRepository.Add(generoAdd);
            _uow.Commit();
            return(_mapper.Map <GeneroViewModel>(generoAdd));
        }
Example #3
0
        public GeneroViewModel Put(int id, GeneroInputModel genero)
        {
            var generoUpd = _mapper.Map <Genero>(genero);

            _uow.GeneroRepository.Update(generoUpd);
            _uow.Commit();

            return(_mapper.Map <GeneroViewModel>(generoUpd));
        }
Example #4
0
        public GeneroViewModel Put(int id, GeneroInputModel GeneroInputModel)
        {
            var Genero = _mapper.Map <Genero>(GeneroInputModel);

            _uow.GeneroRepository.Update(Genero);
            _uow.Commit();

            return(_mapper.Map <GeneroViewModel>(Genero));
        }
Example #5
0
        public GeneroViewModel Post(GeneroInputModel GeneroInputModel)
        {
            var Genero = _mapper.Map <Genero>(GeneroInputModel);

            _uow.GeneroRepository.Add(Genero);
            _uow.Commit();

            return(_mapper.Map <GeneroViewModel>(Genero));
        }
Example #6
0
        public ActionResult Put(int id, [FromBody] GeneroInputModel genero)
        {
            if (id != genero.Id)
            {
                return(BadRequest());
            }

            var generoUpd = _generoService.Put(id, genero);

            return(new CreatedAtRouteResult("GetGeneroDetails", new { Id = generoUpd.Id }, generoUpd));
        }
        public ActionResult Put(int id, [FromBody] GeneroInputModel Genero)
        {
            if (id != Genero.Id)
            {
                return(BadRequest());
            }

            var result = _GeneroService.Put(id, Genero);

            return(new CreatedAtRouteResult("GetGenerosDetails",
                                            new { id = result.Id }, result));
        }
Example #8
0
        public ActionResult Post([FromBody] GeneroInputModel genero)
        {
            var generoAdd = _generoService.Post(genero);

            return(new CreatedAtRouteResult("GetGeneroDetails", new { Id = generoAdd.Id }, generoAdd));
        }