createFromMap method

FutureOr<O> createFromMap(
  1. Map<String, dynamic> fields, {
  2. EntityProvider? entityProvider,
  3. EntityCache? entityCache,
  4. EntityResolutionRules? resolutionRules,
})

Implementation

FutureOr<O> createFromMap(Map<String, dynamic> fields,
    {EntityProvider? entityProvider,
    EntityCache? entityCache,
    EntityResolutionRules? resolutionRules}) {
  try {
    var ret = entityHandler.createFromMap(fields,
        entityProvider: entityProvider,
        entityCache: entityCache,
        resolutionRules: resolutionRules);

    return ret.then((o) => o, onError: (e, s) {
      _log.severe(
          "Error creating `${entityHandler.type}` from fields Map: $fields",
          e,
          s);

      throw e;
    });
  } catch (e, s) {
    _log.severe(
        "Error creating `${entityHandler.type}` from fields Map: $fields",
        e,
        s);
    rethrow;
  }
}