2017-06-05 57 views
0

在为模型创建服务之后,如何告诉模型使用该服务?Exrin服务如何注册到相应的模型?

在样本特斯拉的应用程序,存在这要求服务作为参数的构造函数:

private readonly IClimateService _service; 

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

我搜索,但从未发现那里的模型接收服务,但我没有找到这样的:

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

回答

1

Exrin自动加载服务,通过反射,如果他们从

Exrin.Abstraction.IService 
继承
相关问题