public void Edit(BookVariableInfo bookVariableInfo) { using (BookMarketDbContext db = new BookMarketDbContext()) { db.EditBookVariableInfo(bookVariableInfo.Id, bookVariableInfo.ProductCount, bookVariableInfo.Price); } }
public BookSummary(Book book, BookVariableInfo bookVariableInfo) : this(book) { this.ProductCount = bookVariableInfo.ProductCount; this.Price = bookVariableInfo.Price; }
//Извлечение и создание информации о книге по BookSummary public BookVariableInfo MakeBookVariableInfo( BookSummary bookSummary, Book book) { BookVariableInfo bookVariableInfo; bookVariableInfo = new BookVariableInfo(){ Id = book.Id, Price = bookSummary.Price, ProductCount = bookSummary.ProductCount, Book = book }; this._bookVariableInfoRepository.Add(bookVariableInfo); return bookVariableInfo; }