public static void SoftDelete(int id) { SinaicspDataModelContainer _context = new Sinaicsp_API.SinaicspDataModelContainer(); GC_Category _item = _context.GC_Category.FirstOrDefault(a => a.Id == id); _item.IsDeleted = true; _context.SaveChanges(); }
public static bool Update(int id, string name) { SinaicspDataModelContainer _context = new Sinaicsp_API.SinaicspDataModelContainer(); GC_Category itemById = _context.GC_Category.FirstOrDefault(a => a.Id == id); GC_Category _item = itemById; _item.Name = name; _context.SaveChanges(); return(true); }