Esempio n. 1
0
        public async Task <ServiceResponse <CategoryBookDTO_ToReturn> > CreateCategoryBook(CategoryBookDTO_ToCreate AddCategoryBook)
        {
            var newCategoryBook = new mCategoryBook();

            newCategoryBook.Type     = AddCategoryBook.Type;
            newCategoryBook.CodeType = AddCategoryBook.CodeType;
            _dbContext.Add(newCategoryBook);
            await _dbContext.SaveChangesAsync();

            return(ResponseResult.Success(_mapper.Map <CategoryBookDTO_ToReturn>(newCategoryBook)));
        }
 public async Task <IActionResult> AddACustomer(CategoryBookDTO_ToCreate AddCategoryBook)
 {
     return(Ok(await _categoryBookService.CreateCategoryBook(AddCategoryBook)));
 }