public BookCategoryEntity Create(BookCategoryEntity model) { _context.book_category.Add(model); _context.SaveChanges(); return(model); }
public BookCategoryEntity Delete(Guid book_category_id) { var book_category = new BookCategoryEntity() { book_category_id = book_category_id }; var data = _context.book_category.Remove(book_category); _context.SaveChanges(); return(book_category); }
public BookCategoryEntity Update(Guid id, BookCategoryEntity modelUpdate) { var data = _context.book_category.Find(id); modelUpdate.book_category_id = data.book_category_id; modelUpdate.created_at = data.created_at; data.code = modelUpdate.code; data.name = modelUpdate.name; data.updated_at = modelUpdate.updated_at; _context.SaveChanges(); return(modelUpdate); }