예제 #1
0
 // Creates a Note and inserts it into the collection in MongoDB.
 public void CreateNote(Note note)
 {
     IMongoCollection<Note> collection = GetNotesCollectionForEdit();
     try
     {
        collection.InsertOneAsync(note);
     }
     catch (MongoCommandException ex)
     {
         string msg = ex.Message;
     }
 }
예제 #2
0
 public ActionResult Create(Note note)
 {
     try
     {
         dal.CreateNote(note);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }