EFTable<T extends IModel> constructor

EFTable<T extends IModel>({
  1. required String tableName,
  2. List<PropertyEnum>? enumProperties,
  3. List<EFProperty<T>>? properties,
  4. required PrimaryKeyGetDelegate<T> primaryKeyGet,
  5. required PrimaryKeySetDelegate<T> primaryKeySet,
  6. required NewEmptyObjectDelegate<T> newEmptyObject,
  7. PrimaryKeyEnum primrayKeyType = PrimaryKeyEnum.Default,
  8. FromMapFunc<T>? fromMap,
  9. ToMapFunc<T>? toMap,
  10. bool isAutoMap = true,
  11. bool isUseEnum = false,
  12. String primaryKeyName = "id",
  13. List<T>? defaultValues,
})

Implementation

EFTable(
    {required this.tableName,
    this.enumProperties,
    this.properties,
    required this.primaryKeyGet,
    required this.primaryKeySet,
    required this.newEmptyObject,
    this.primrayKeyType = PrimaryKeyEnum.Default,
    this.fromMap,
    this.toMap,
    this.isAutoMap = true,
    this.isUseEnum = false,
    this.primaryKeyName = "id",
    this.defaultValues}) {
  if (isUseEnum) {
    isAutoMap = false;
    properties = enumProperties!
        .map((e) => EFProperty<T>(name: e.name, type: e.type))
        .toList();
  }
}