public static void SoftDelete(int id) { SinaicspDataModelContainer _context = new Sinaicsp_API.SinaicspDataModelContainer(); Inclusion _item = _context.Inclusions.FirstOrDefault(a => a.Id == id); _item.IsDeleted = true; _context.SaveChanges(); }
public static bool Update(int id, string subject, string classes, string teacher, string sessionStart, string sessionEnd, int LoggeduserId) { SinaicspDataModelContainer _context = new Sinaicsp_API.SinaicspDataModelContainer(); Inclusion _item = _context.Inclusions.FirstOrDefault(a => a.Id == id); _item.Subject = subject; _item.Classes = classes; _item.Teacher = teacher; _item.SessionStart = sessionStart; _item.SessionEnd = sessionEnd; _context.SaveChanges(); return(true); }