Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            OSSystem ossystem = db.OSSystems.Find(id);

            db.OSSystems.Remove(ossystem);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
        public ActionResult Delete(int id = 0)
        {
            OSSystem ossystem = db.OSSystems.Find(id);

            if (ossystem == null)
            {
                return(HttpNotFound());
            }
            return(View(ossystem));
        }
Exemple #3
0
 public ActionResult Edit(OSSystem ossystem)
 {
     if (ModelState.IsValid)
     {
         db.Entry(ossystem).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(ossystem));
 }
Exemple #4
0
        public ActionResult Create(OSSystem ossystem)
        {
            if (ModelState.IsValid)
            {
                db.OSSystems.Add(ossystem);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(ossystem));
        }
Exemple #5
0
 public static TResult On <TResult>(this OSSystem thisValue, Func <TResult> onWindows, Func <TResult> onLinux, Func <TResult> onMacOS)
 => thisValue switch
 {
Exemple #6
0
 public static void On(this OSSystem thisValue, Action onWindows, Action onLinux, Action onMacOS)
 => thisValue.OnWindows(onWindows).OnLinux(onLinux).OnMacOS(onMacOS);
Exemple #7
0
 public static bool IsMacOS(this OSSystem thisValue)
 => thisValue == OSSystem.MacOS;
Exemple #8
0
 public static bool IsLinux(this OSSystem thisValue)
 => thisValue == OSSystem.Linux;
Exemple #9
0
 public static bool IsWindows(this OSSystem thisValue)
 => thisValue == OSSystem.Windows;