在为模型创建服务之后,如何告诉模型使用该服务?
在示例Tesla应用程序中,存在调用服务作为参数的构造函数:
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();
}发布于 2017-06-06 09:15:27
Exrin通过反射自动加载服务,如果它们是从
Exrin.Abstraction.IServicehttps://stackoverflow.com/questions/44379091
复制相似问题