public IActionResult BookGroup(BookGroupDto bookGroupDto) { var bookGroup = _mapper.Map <BookGroup>(bookGroupDto); _bookGroupService.InsertBookGroup(bookGroup); bookGroupDto = _mapper.Map <BookGroupDto>(bookGroup); var response = new ApiResponse <BookGroupDto>(bookGroupDto); return(Ok(response)); }
public IActionResult Put(int id, BookGroupDto bookGroupDto) { var bookGroup = _mapper.Map <BookGroup>(bookGroupDto); bookGroup.Id = id; Debug.WriteLine("run controller"); var result = _bookGroupService.UpdateBookGroup(bookGroup); var response = new ApiResponse <bool>(result); return(Ok(response)); }