public async Task AddTeacherBook(AddBookToFavoritesViewModel request) { Book book = await bookRepository.GetByTitle(request.Booktitle); Teacher user = await teacherRepository.GetByName(request.Name, request.Surname); TeacherBook createRequest = new TeacherBook { BookId = book.Id, TeacherId = user.Id }; await teacherBookRepository.Create(createRequest); }
public async Task AddBookToFavorites(AddBookToFavoritesViewModel request) { Book book = await bookRepository.GetByTitle(request.Booktitle); Student user = await studentRepository.GetByName(request.Name, request.Surname); StudentBook createRequest = new StudentBook { BookId = book.Id, StudentId = user.Id }; await studentBookRepository.Create(createRequest); }
public async Task AddTeacherBook(AddBookToFavoritesViewModel request) { await libraryService.AddTeacherBook(request); }