create method

Future<TEntity> create(
  1. TEntity entity, {
  2. RepositoryTransaction? transaction,
})

Implementation

Future<TEntity> create(
  TEntity entity, {
  RepositoryTransaction? transaction,
}) async {
  validator.validateThrowing(entity);
  var map = mapMapper.toMap(entity);
  map =
      await repository.create(map, call.principal, transaction: transaction);

  entity = mapMapper.fromMap(map);
  return entity;
}