예제 #1
0
 public void Update(BookEntity bookEntity)
 {
     BookEntity savedEntity = FindById(bookEntity.Id);
     savedEntity.Id = bookEntity.Id;
     savedEntity.ISBN = bookEntity.ISBN;
     savedEntity.Name = bookEntity.Name;
     savedEntity.Price = bookEntity.Price;
     savedEntity.AuthorId = bookEntity.AuthorId;
     savedEntity.CategoryId = bookEntity.CategoryId;
 }
예제 #2
0
 private BookEntity Clone(BookEntity bookEntity)
 {
     BookEntity newEntity = new BookEntity();
     newEntity.Id = bookEntity.Id;
     newEntity.ISBN = bookEntity.ISBN;
     newEntity.Name = bookEntity.Name;
     newEntity.Price = bookEntity.Price;
     newEntity.AuthorId = bookEntity.AuthorId;
     newEntity.CategoryId = bookEntity.CategoryId;
     return newEntity;
 }
예제 #3
0
 public void Create(BookSaveDto bookDto)
 {
     var bookEntity = new BookEntity
     {
         Id = bookDto.Id,
         AuthorId = bookDto.AuthorId,
         CategoryId = bookDto.CategoryId,
         ISBN = bookDto.ISBN,
         Name = bookDto.Name,
         Price = bookDto.Price
     };
     this.bookRepository.Create(bookEntity);
 }
예제 #4
0
 public void Delete(BookEntity bookEntity)
 {
     BookEntity savedEntity = FindById(bookEntity.Id);
     bookList.Remove(savedEntity);
 }
예제 #5
0
 public void Create(BookEntity bookEntity)
 {
     var newBook = Clone(bookEntity);
     newBook.Id = bookList.Count;
     bookList.Add(newBook);
 }