Ejemplo n.º 1
0
        public string Post(UserModel user)
        {
            MongoManager dbManager = new MongoManager("Data_Classifier");

            dbManager.InsertRecord <UserModel>("Users", user);
            //var identity = HttpContext.User.Identity as ClaimsIdentity;
            //IList<Claim> claim = identity.Claims.ToList();
            //var userName = claim[0].Value;
            return("Succes!");
        }
Ejemplo n.º 2
0
        public string Post(string record, int id)
        {
            var         doc     = new BsonDocument();
            BsonElement element = new BsonElement("record", new BsonString(record));

            doc.Add(element);
            BsonElement elementID = new BsonElement("id", new BsonInt32(id));

            doc.Add(elementID);
            dbManager.InsertRecord("Uploads", doc);
            return("");
        }