getOneRequired<T> method

T getOneRequired<T>(
  1. String name
)

Gets one required dependency by its name. At least one dependency must present. If the dependency was found it throws a ReferenceException

  • name the dependency name to locate. Returns a dependency reference

Throws a ReferenceException if dependency was not found.

Implementation

T getOneRequired<T>(String name) {
  var locator = locate(name);
  if (locator == null) throw ReferenceException(null, name);

  return _references!.getOneRequired<T>(locator);
}