select method

ExpandQueryField select(
  1. String fields
)

Implementation

ExpandQueryField select(String fields) {
  if (_selectAll) {
    throw Exception("[OData Helper] Defining fields to select when 'selectAll' is enabled is useless");
  }

  fields = fields.replaceAll(RegExp(r"\s"), "");

  if (!RegExp(r"^[a-zA-z_0-9,]*$").hasMatch(fields)) {
    throw Exception("[OData Helper] select fields can only have letters, numbers and underscore");
  }

  return selectList(fields.split(","));
}