public int Create(CreateBookShopDto createBookShopDto)
        {
            var bookShopEntity = _mapper.Map <BookShop>(createBookShopDto);

            _dbContext.BookShops.Add(bookShopEntity);
            _dbContext.SaveChanges();

            return(bookShopEntity.Id);
        }
Beispiel #2
0
        public ActionResult CreateBookShop([FromBody] CreateBookShopDto createBookShopDto)
        {
            var newBookShopId = _bookShopService.Create(createBookShopDto);

            return(Created($"api/BookShop/{newBookShopId}", null));
        }