registerInto - multiple declarations

Function registerInto

Register an object into a storage by storageId located in storageLocator.

auto auto registerInto(Type, R) (
  R storageLocator,
  Locator!() locator,
  string storageId = "singleton"
)
if (!is(R : Storage!(ObjectFactory, string)));

auto auto registerInto(Type, R) (
  R locator,
  string storageId = "singleton"
)
if (!is(R : Storage!(ObjectFactory, string)));

Parameters

NameDescription
Type the type of object registered in storage
storageLocator locator containing the storage where to store object.
locator locator used to fetch dependencies for registered object
id the id of object registered in storage
storageId the id of storage where object is stored.

Throws

NotFoundException when storage with storageId is not found.

Returns

storageLocator for further configuration

Function registerInto

Register data into an object storage located in locator by storageId.

auto auto registerInto(Type, R) (
  R locator,
  Type data,
  string storageId = "parameters"
)
if (!is(R : Storage!(Object, string)));

Parameters

NameDescription
Type the type of object registered in storage
locator locator containing object storage were data is saved.
data the actual data saved in storage
id the id by which data will be identified
storageId identity of storage in locator