Esempio n. 1
0
 public override void Updates(BenchmarksContainer bc)
 {
     bc.Add(d =>
     {
         _db.Update(new { title = "Updated" }, 5);
     }, "massive");
 }
Esempio n. 2
0
        public OperationResult <int> UpdateContact(Contact contact)
        {
            var result = new OperationResult <int>();

            result.Data = table.Update(contact, contact.Id);
            return(result);
        }
Esempio n. 3
0
        public ActionResult Edit()
        {
            var model = SqueezeJson();

            _productions.Update(model, model.ID);
            return(VidpubJSON(model));
        }
Esempio n. 4
0
        protected override void Update(GameTime gameTime)
        {
            cat.Update(gameTime);

            PluginManager.Update(gameTime);

            base.Update(gameTime);
        }
Esempio n. 5
0
        public ActionResult Update(int id, FormCollection formCollection)
        {
            var model = tbl.CreateFrom(formCollection);

            try
            {
                tbl.Update(model, id);
            }
            catch (Exception x)
            {
                TempData["Error"] = "There was a problem editing this record";
            }


            return(null);
        }
Esempio n. 6
0
        public static dynamic Process(DataProcessRequest request)
        {
            dynamic result = null;
            var     tbl    = new DynamicModel(ConnectionString, tableName: request.EntityType.Name, primaryKeyField: "Id");

            switch (request.Type)
            {
            case RequestType.GET:
                if (request.Object != null)
                {
                    throw new NotImplementedException();
                    //result = tbl.
                }
                else
                {
                    result = tbl.All();
                }
                break;

            case RequestType.POST:
                // Id is not allowed when doing an insert as this is the auto generated key as IDENTITY(1,1)
                IDictionary <string, object> map = ObjectExtensions.ToDictionary(request.Object);
                map.Remove("Id");
                result = tbl.Insert(map);
                break;

            case RequestType.UPDATE:
                result = tbl.Update(request.Object);
                break;

            case RequestType.PUT:
                throw new NotImplementedException();
                break;

            case RequestType.DELETE:
                throw new NotImplementedException();
                break;

            default:
                break;
            }
            return(result);
        }