create method

  1. @override
FutureOr<void> create(
  1. ProjectBeneficiaryModel entity, {
  2. bool createOpLog = true,
  3. DataOperation dataOperation = DataOperation.create,
})
override

The create method creates a new entity.

Implementation

@override
FutureOr<void> create(
  ProjectBeneficiaryModel entity, {
  bool createOpLog = true,
  DataOperation dataOperation = DataOperation.create,
}) async {
  return retryLocalCallOperation(() async {
    final projectBeneficiaryCompanion = entity.companion;
    await sql.batch((batch) {
      batch.insert(sql.projectBeneficiary, projectBeneficiaryCompanion);
    });

    await super.create(entity);
  });
}