public async Task <ActionResult> DeleteConfirmed(int id)
        {
            if (!AdminUserIsLoggedIn)
            {
                return(new HttpUnauthorizedResult());
            }

            MvvmTemplateCategory mvvmTemplateCategory = await db.MvvmTemplateCategories.FindAsync(id);

            db.MvvmTemplateCategories.Remove(mvvmTemplateCategory);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
        public async Task <ActionResult> Edit([Bind(Include = "Id,Name")] MvvmTemplateCategory mvvmTemplateCategory)
        {
            if (!AdminUserIsLoggedIn)
            {
                return(new HttpUnauthorizedResult());
            }

            if (ModelState.IsValid)
            {
                db.Entry(mvvmTemplateCategory).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(mvvmTemplateCategory));
        }
        // GET: MvvmTemplateCategories/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (!AdminUserIsLoggedIn)
            {
                return(new HttpUnauthorizedResult());
            }

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MvvmTemplateCategory mvvmTemplateCategory = await db.MvvmTemplateCategories.FindAsync(id);

            if (mvvmTemplateCategory == null)
            {
                return(HttpNotFound());
            }
            return(View(mvvmTemplateCategory));
        }