public ActionResult Edit(string id)
        {
            UserViewModel user = new UserViewModel();

            BsonDocument bDoc = new BsonDocument();
            bDoc.Add("_id", ObjectId.Parse(id));

            var userValue = userCollection.Find(bDoc).Single();

            user.ID = userValue["_id"].ToString();
            user.Name = userValue["Name"].AsString;
            user.Lastname = userValue["Lastname"].AsString;
            user.Username = userValue["Username"].AsString;
            user.Password = userValue["Password"].AsString;


            return View(user);
        }
        public ActionResult Add(UserViewModel user)
        {
            if (ModelState.IsValid)
            {
                BsonDocument bDoc = new BsonDocument();
                bDoc.Add("Name", user.Name);
                bDoc.Add("Lastname", user.Lastname);
                bDoc.Add("Username", user.Username);
                bDoc.Add("Password", user.Password);

                userCollection.InsertOne(bDoc);

                TempData.Add("OperationResult", "Ekleme işlemi tamamladı.");

                return RedirectToAction("Index", "Home");
            }

            return View();
        }
        public ActionResult Edit(UserViewModel user)
        {
            if (ModelState.IsValid)
            {
                BsonDocument filter = new BsonDocument();
                filter.Add("_id", ObjectId.Parse(user.ID));


                BsonDocument bDoc = new BsonDocument();
                bDoc.Add("_id", ObjectId.Parse(user.ID));
                bDoc.Add("Name", user.Name);
                bDoc.Add("Lastname", user.Lastname);
                bDoc.Add("Username", user.Username);
                bDoc.Add("Password", user.Password);

                ReplaceOneResult ror = userCollection.ReplaceOne(filter, bDoc);

                return RedirectToAction("Index", "Home");
            }

            return View(user);
        }