Exemplo n.º 1
0
        public async Task AddNewBookToAuthorTest_1()
        {
            var conString = "Server=DESKTOP-RF07Q5U;Database=AspCoreBookApp;Trusted_Connection=True;MultipleActiveResultSets=true";

            IRepositoryContextFactory repositoryContextFactory = new RepositoryContextFactory();

            IAuthorRepository authorRepository = new AuthorRepository(conString, repositoryContextFactory);
            IBookRepository   bookRepository   = new BookRepository(conString, repositoryContextFactory);



            var txt = await bookRepository.AddBookToAuthor(new BooksToAuthors { BookId = 5, AuthorId = 3 });

            var authorList = await bookRepository.GetBooks(0, 10);

            var ext = authorList.Records.ToList();
        }