save method

Future<int> save({
  1. SaveOptions? saveOptions,
})

Implementation

Future<int> save({SaveOptions? saveOptions}) async {
  if (this.data is List) {
    return this.repository.saveMany(
        entities: this.data as List<T>,
        database: this.database,
        mergeMode: this._mergeMode,
        saveOptions: saveOptions);
  }
  if (this.data != null && this.data.lastUpdated == null) {
    this.data.lastUpdated = DateTime.now().toIso8601String();
  }

  return this.repository.saveOne(
      entity: this.data as T,
      database: this.database,
      mergeMode: this._mergeMode,
      saveOptions: saveOptions);
}