Exemplo n.º 1
0
        public void Put(int id, [FromBody] AdapterContext.DataModel.DataItem dataItem)
        {
            var obj = this._ctx.DataItems.FirstOrDefault(o => o.Id == dataItem.Id);

            if (obj != null)
            {
                obj.IsActive               = dataItem.IsActive;
                obj.TickFrequency          = dataItem.TickFrequency;
                this._ctx.Entry(obj).State = EntityState.Modified;
                this._ctx.SaveChanges();
            }
            else
            {
                NotFound();
            }
        }
Exemplo n.º 2
0
 public void Post([FromBody] AdapterContext.DataModel.DataItem dataItem)
 {
     throw new NotSupportedException("Cannot create new DataItems. This is managed in the system.");
 }