/** * Adding item to the DB (C) */ public Item AddItem(Item item) { if (item == null) { return(null); } _context.Add(item); _context.SaveChanges(); return(item); }
/** * Adding new category (C) */ public Category AddNewCategory(Category category) { if (category == null) { return(null); } _context.Add(category); _context.SaveChanges(); return(category); }