entityOrIdToJson method

Object? entityOrIdToJson()

Encodes entity or id as JSON. If isNull returns null.

Implementation

Object? entityOrIdToJson() {
  if (isNull) return null;

  if (isEntitySet) {
    return entityToJson();
  } else if (isIdSet) {
    return id!;
  } else {
    return null;
  }
}