public Book UpdateBook(Book book) { var oldBook = _context.Books.FirstOrDefault(b => b.BookId == book.BookId); _context.Entry(oldBook).CurrentValues.SetValues(book); return(book); }
public ProductBase UpdateProduct(ProductBase product) { var oldProduct = GetProduct(product.Id); _context.Entry(oldProduct).CurrentValues.SetValues(product); _context.SaveChanges(); return(product); }
public Author UpdateAuthor(Author author) { var oldAuthor = GetAuthor(author.AuthorId); _context.Entry(oldAuthor).CurrentValues.SetValues(author); _context.SaveChanges(); return(author); }
public ProductState UpdateProductState(ProductState productState) { var oldState = _context.ProductStates.FirstOrDefault(p => p.Id == productState.Id); _context.Entry(oldState).CurrentValues.SetValues(productState); _context.SaveChanges(); return(productState); }
public Publisher UpdatePublisher(Publisher publisher) { var oldPubl = GetPublisher(publisher.Id); _context.Entry(oldPubl).CurrentValues.SetValues(publisher); _context.SaveChanges(); return(publisher); }
public Category UpdateCategory(Category category) { var oldCategory = _context.Categories.FirstOrDefault(c => c.Id == category.Id); _context.Entry(oldCategory).CurrentValues.SetValues(category); _context.SaveChanges(); return(category); }
public Language UpdateLanguage(Language lang) { var oldLang = GetLanguage(lang.Id); _context.Entry(oldLang).CurrentValues.SetValues(lang); _context.SaveChanges(); return(lang); }
public Format UpdateFormat(Format format) { var oldFormat = GetFormat(format.Id); _context.Entry(oldFormat).CurrentValues.SetValues(format); _context.SaveChanges(); return(format); }