Пример #1
0
        public Profiles AddProfile(Profiles item)
        {
            item.Id = ObjectId.GenerateNewId().ToString();

            _profiles.Insert(item);
            return item;
        }
Пример #2
0
        public bool UpdateProfile(string Id, Profiles item)
        {
            IMongoQuery query = Query.EQ("_id", Id);

            IMongoUpdate update = Update
                .Set("UserName", item.UserName)
                .Set("Company", item.Company)
                .Set("Stationgroup", item.Stationgroup)
                .Set("loc", item.loc)
                .Set("Mobile", item.Mobile)
                .Set("Email", item.Email)
                .Set("place", item.place);
            //.Set("UnleadedExtra", item.UnleadedExtra)
            // .Set("Petrol", item.Petrol)
            // .Set("Diesel", item.Diesel);
            //.Set("UnleadedExtra",item.UnleadedExtra)
            // .Set("LastModified", DateTime.UtcNow)
            //.Set("By", item.By);

            WriteConcernResult result = _profiles.Update(query, update);
            return result.UpdatedExisting;
        }