Beispiel #1
0
 // Creates a Task and inserts it into the collection in MongoDB.
 public void CreateTask(Task task)
 {
     MongoCollection<Task> collection = GetTasksCollectionForEdit();
     try
     {
         collection.Insert(task, SafeMode.True);
     }
     catch (MongoCommandException ex)
     {
         string msg = ex.Message;
     }
 }
Beispiel #2
0
 public ActionResult Create(Task task)
 {
     try
     {
         dal.CreateTask(task);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }