code: function (context, payload) {
          var state = context.state;
          var entity = state.$name;
          return context.dispatch(state.$connection + "/insertOrUpdate", __assign({ entity: entity }, payload), { root: true });
      }
docs: Insert or update given data to the state. Unlike `insert`, this method
  will not replace existing data within the state, but it will update only
  the submitted data with the same primary key.