public CopyInfo(BookItem bookItem, int stock, double prize, string currency) { this.bookItem = bookItem; this.stock = stock; this.prize = prize; this.currency = currency; id = Guid.NewGuid(); }
public int FindBookItem(string title, string author) { BookItem pattern = new BookItem(title, author); int key = -1; foreach (BookItem element in dataContext.books.Values) { if (element.Equals(pattern)) { key = dataContext.books.FirstOrDefault(x => x.Value.Equals(pattern)).Key; return(key); } } return(key); }