本文整理汇总了C#中ILocator.Locate方法的典型用法代码示例。如果您正苦于以下问题:C# ILocator.Locate方法的具体用法?C# ILocator.Locate怎么用?C# ILocator.Locate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILocator
的用法示例。
在下文中一共展示了ILocator.Locate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Job
public Job(JobDescriptor jobDescription, Guid workerId, ILocator locator)
{
_serviceLocator = locator;
_jobRepository = locator.Locate<IJobRepository>();
_apiRepository = locator.Locate<IApiDataRepository>();
Id = jobDescription.Id;
WorkerId = workerId;
JobDescriptor = jobDescription;
}
示例2: JobPoller
public JobPoller(WorkloadPresenter presenter, ILocator locator, WorkerState worker, int? intervalSeconds = null)
{
_interval = intervalSeconds ?? _interval;
_presenter = presenter;
_jobRepository = locator.Locate<IJobRepository>();
_worker = worker;
_serviceLocator = locator;
}
示例3: UpdateUserCodeLocationsJob
public UpdateUserCodeLocationsJob(JobDescriptor jobDescription, Guid workerId, ILocator locator) : base(jobDescription, workerId, locator)
{
_apiDataRepository = locator.Locate<IApiDataRepository>();
_codeLocationRepository = locator.Locate<ICodeLocationRepository>();
}
示例4: WorkerRegistrationController
public WorkerRegistrationController(ILocator locator)
{
_repository = locator.Locate<IWorkerRepository>();
}