public void Add(FavoriteBookModel model) { var dto = _mapper.Map <FavoriteBookDto>(model); dto.User = _requestScope.GetUser(); _favoriteBookService.Add(dto); }
public void FavoriteBookApplicationService_Add() { var model = new FavoriteBookModel { Title = "test", Description = "test", Authors = new List <string>() { "test", "test2" }, BookId = "test", Link = "test", Thumbnail = "test" }; _favoriteBookApplicationService.Add(model); var result = _favoriteBookRepository.Get(new Filter()); result.totalItems.Should().Be(1); result.entities.Should().HaveCount(1); }
public IActionResult Add([FromBody] FavoriteBookModel model) { _favoriteBookApplicationService.Add(model); return(Response()); }