internal void Update(UserBook userBook) { userBook.BookId = book; userBook.UserId = user; userBook.LearnLevels = learnLevels; userBook.LearnDates = learnDates; userBook.ExamDates = examDates; userBook.PromoteDates = promoteDates; }
public UserBookDto(UserBook userBook, Book book) { this.id = userBook.Id; this.user = userBook.UserId; this.book = userBook.BookId; this.learnLevels = userBook.LearnLevels; this.learnDates = userBook.LearnDates; this.examDates = userBook.ExamDates; this.promoteDates = userBook.PromoteDates; this.BookDto = new BookDto(book, id); this.translations = new Dictionary <string, List <int> >(); }
//internal async Task CreateFirstBook(string userId, LanguageType language) { // var targetBook = await CreateUserBookAsync(userId, language, "J.London, Martin Eden"); // try { // await this.Database.ExecuteSqlCommandAsync("exec dbo.CopyBookWords @sourceBookId, @targetBookId", // new SqlParameter("@sourceBookId", 1), // new SqlParameter("@targetBookId", targetBook.Id)); // } catch (Exception e) { // _logger.Error(e, "Error calling dbo.CopyBookWords procedure"); // } //} internal async Task <UserBook> CreateUserBookForBookAsync(int bookId, string userId) { var userBook = new UserBook() { UserId = userId, BookId = bookId }; UserBooks.Add(userBook); await SaveChangesAsync(); return(userBook); }
public UserBookDto(UserBook userBook, Book book) { this.id = userBook.Id; this.user = userBook.UserId; this.book = userBook.BookId; this.learnLevels = userBook.LearnLevels; this.learnDates = userBook.LearnDates; this.examDates = userBook.ExamDates; this.promoteDates = userBook.PromoteDates; this.BookDto = new BookDto(book, id); this.translations = new Dictionary<string, List<int>>(); }
public UserBookDto(UserBook userBook) : this(userBook, userBook.Book) { }