示例#1
0
 public ActionResult Create(TagDetailIdentifierCollection collection)
 {
     try
     {
         // TODO: Add insert logic here
         if (ModelState.IsValid)
         {
             collection.DocumentType = "TagDetailIdentifier";
             _tagDetailIdentifierContext.Create(collection);
         }
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
示例#2
0
        public bool Create(TagDetailIdentifierCollection tagDetail)
        {
            var returnRes = false;

            try
            {
                var tagDetailDocument   = tagDetail.ToBsonDocument();
                var tagDetailCollection = _database.GetCollection <BsonDocument>("TagDetailIdentifierCollection");
                tagDetailCollection.InsertOne(tagDetailDocument);
                returnRes = true;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(returnRes);
        }