asListOfDBObjects<E> function

List<E> asListOfDBObjects<E>(
  1. NUIDBEntityMapper<E> entity,
  2. dynamic value
)

Implementation

List<E> asListOfDBObjects<E>(NUIDBEntityMapper<E> entity, dynamic value){
  if(value == null) return List();
  var endValue = value;
  if(value is String){
    endValue = jsonDecode(value);
  }
  List<E> list = (endValue as List).map((i) =>
      entity.toEntity(i)).toList();
  return list;
}