Example #1
0
 public AuthorService(IAuthorRepository artistRepository,
                      IBookRepository itemRepository,
                      IAuthorMapper artistMapper, IBookMapper itemMapper)
 {
     _artistRepository = artistRepository;
     _itemRepository   = itemRepository;
     _artistMapper     = artistMapper;
     _itemMapper       = itemMapper;
 }
 public AuthorModelService(IAuthorService service, IAuthorMapper mapper)
 {
     if (service == null || mapper == null)
     {
         throw new ArgumentNullException("Cannot pass null as argument for AuthorModelService constructor");
     }
     _mapper  = mapper;
     _service = service;
 }
Example #3
0
        public BookShopContextFactory()
        {
            var contextOptions = new
                                 DbContextOptionsBuilder <BookShopContext>()
                                 .UseInMemoryDatabase(Guid.NewGuid().ToString())
                                 .EnableSensitiveDataLogging()
                                 .Options;

            EnsureCreation(contextOptions);
            ContextInstance = new TestBookShopContext(contextOptions);
            GenreMapper     = new GenreMapper(); ArtistMapper = new AuthorMapper();
            BookMapper      = new BookMapper(ArtistMapper, GenreMapper);
        }
Example #4
0
 public BookMapper(IAuthorMapper authorMapper, IGenreMapper genreMapper)
 {
     _authorMapper = authorMapper;
     _genreMapper  = genreMapper;
 }
Example #5
0
 public BookMapper(IAuthorMapper authorMapper)
 {
     _authorMapper = authorMapper;
 }