public MakerSpaceReadDto GetMakerSpaceById(Guid id) { var makerSpace = _repo.GetMakerSpaceById(id); if (makerSpace == null) { throw new NullReferenceException(); } return(_mapper.Map <MakerSpaceReadDto>(makerSpace)); }
[HttpGet("{id}", Name = "GetMakerSpaceById")] //Named so the Post can use it public ActionResult <MakerSpaceReadDto> GetMakerSpaceById(int id) { var makerSpace = _repo.GetMakerSpaceById(id); return(Ok(_mapper.Map <MakerSpaceReadDto>(makerSpace))); }