コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public async Task AddTeacherBook(AddBookToFavoritesViewModel request)
 {
     await libraryService.AddTeacherBook(request);
 }