public ActionResult DeleteConfirmed(int id) { OSSystem ossystem = db.OSSystems.Find(id); db.OSSystems.Remove(ossystem); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Delete(int id = 0) { OSSystem ossystem = db.OSSystems.Find(id); if (ossystem == null) { return(HttpNotFound()); } return(View(ossystem)); }
public ActionResult Edit(OSSystem ossystem) { if (ModelState.IsValid) { db.Entry(ossystem).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ossystem)); }
public ActionResult Create(OSSystem ossystem) { if (ModelState.IsValid) { db.OSSystems.Add(ossystem); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ossystem)); }
public static TResult On <TResult>(this OSSystem thisValue, Func <TResult> onWindows, Func <TResult> onLinux, Func <TResult> onMacOS) => thisValue switch {
public static void On(this OSSystem thisValue, Action onWindows, Action onLinux, Action onMacOS) => thisValue.OnWindows(onWindows).OnLinux(onLinux).OnMacOS(onMacOS);
public static bool IsMacOS(this OSSystem thisValue) => thisValue == OSSystem.MacOS;
public static bool IsLinux(this OSSystem thisValue) => thisValue == OSSystem.Linux;
public static bool IsWindows(this OSSystem thisValue) => thisValue == OSSystem.Windows;