How are Exrin services registered to their appropriate models?

33 Views Asked by At

After creating a service for a model, how do I tell the model to use that service?

Within the sample Tesla app, there exists constructors which call for a service as an argument:

private readonly IClimateService _service;

public ClimateModel(IExrinContainer exrinContainer, IAuthModel authModel, IClimateService service)
        : base(exrinContainer, new ClimateModelState())
    { _service = service; }

I searched but never found where the model receives the service, but I did find this:

protected override void InitServices()
{
    RegisterTypeAssembly(typeof(IService), new AssemblyName(nameof(TeslaService)));
        base.InitServices();
}
1

There are 1 best solutions below

0
On BEST ANSWER

Exrin automatically loads Services, via reflection, if they inherit from

Exrin.Abstraction.IService