private void AddToEntitySet(Object dataContext, OeOperationMessage operation) { Db.OeEntitySetAdapter entitySetAdapter = _dataAdapter.GetEntitySetAdapter(operation.EntityItem.EntitySet.Name); switch (operation.Method) { case ODataConstants.MethodDelete: entitySetAdapter.RemoveEntity(dataContext, operation.EntityItem.Entity); break; case ODataConstants.MethodPatch: entitySetAdapter.AttachEntity(dataContext, operation.EntityItem.Entity); break; case ODataConstants.MethodPost: entitySetAdapter.AddEntity(dataContext, operation.EntityItem.Entity); break; default: throw new NotImplementedException(operation.Method); } }