コード例 #1
0
 internal void Update(UserBook userBook)
 {
     userBook.BookId       = book;
     userBook.UserId       = user;
     userBook.LearnLevels  = learnLevels;
     userBook.LearnDates   = learnDates;
     userBook.ExamDates    = examDates;
     userBook.PromoteDates = promoteDates;
 }
コード例 #2
0
 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> >();
 }
コード例 #3
0
        //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);
        }
コード例 #4
0
 internal void Update(UserBook userBook)
 {
     userBook.BookId = book;
     userBook.UserId = user;
     userBook.LearnLevels = learnLevels;
     userBook.LearnDates = learnDates;
     userBook.ExamDates = examDates;
     userBook.PromoteDates = promoteDates;
 }
コード例 #5
0
 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>>();
 }
コード例 #6
0
 public UserBookDto(UserBook userBook)
     : this(userBook, userBook.Book)
 {
 }
コード例 #7
0
 public UserBookDto(UserBook userBook)
     : this(userBook, userBook.Book)
 {
 }