//
        // GET: /OauthAccount/Create

        public ActionResult Create()
        {
            OauthAccount account = new OauthAccount();

            FillProviders();
            return(View(account));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            OauthAccount account = db.OauthAccounts.Find(id);

            db.OauthAccounts.Remove(account);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        //
        // GET: /OauthAccount/Delete/5

        public ActionResult Delete(int id = 0)
        {
            OauthAccount account = db.OauthAccounts.Find(id);

            if (account == null)
            {
                return(View("Missing", new MissingItem(id)));
            }
            return(View(account));
        }
        public ActionResult Edit([Bind(Include = "AccountId,Name,Provider,AppId,ClientId,ClientSecret")] OauthAccount account)
        {
            if (ModelState.IsValid)
            {
                db.Entry(account).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            FillProviders(account.Provider);
            return(View(account));
        }
        //
        // GET: /OauthAccount/Edit/5

        public ActionResult Edit(int id = 0)
        {
            OauthAccount account = db.OauthAccounts.Find(id);

            if (account == null)
            {
                return(View("Missing", new MissingItem(id)));
            }

            FillProviders(account.Provider);
            return(View(account));
        }
        public ActionResult Create([Bind(Include = "Name,Provider,AppId,ClientId,ClientSecret")] OauthAccount account)
        {
            if (ModelState.IsValid)
            {
                db.OauthAccounts.Add(account);
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }

            FillProviders(account.Provider);
            return(View(account));
        }