public ActionResult UpdateMakerSpace(int id, MakerSpaceCreateDto MakerSpaceCreateDto)
        {
            var MakerSpaceModelFromRepo = _repo.GetMakerSpaceById(id);

            if (MakerSpaceModelFromRepo == null)
            {
                return(NotFound());
            }

            _mapper.Map(MakerSpaceCreateDto, MakerSpaceModelFromRepo);
            _repo.UpdateMakerSpace(MakerSpaceModelFromRepo);
            _repo.SaveChanges();

            return(NoContent());
        }
Пример #2
0
        public bool UpdateMakerSpace(Guid id, MakerSpaceCreateDto MakerSpaceCreateDto)
        {
            var MakerSpaceModelFromRepo = _repo.GetMakerSpaceById(id);

            if (MakerSpaceModelFromRepo == null)
            {
                return(false);
            }

            _mapper.Map(MakerSpaceCreateDto, MakerSpaceModelFromRepo);
            _repo.UpdateMakerSpace(MakerSpaceModelFromRepo);
            _repo.SaveChanges();

            return(true);
        }