convertToDtoIf

suspend fun <TEntity : Any, TDto : Any> DtoConverter<TEntity, TDto>.convertToDtoIf(entity: TEntity, predicate: () -> Boolean): TDto?

Converts given entity to DTO if the given predicate matches. Returns null otherwise.