我想知道是否有人可以在这段代码的一行中解释语法:下面的 doBgProcess 函数,当我从控制器类调用它工作正常但是当我试图从 OnStart() 函数中的工作角色调用它时,它会抛出异常“对象引用未设置为对象的实例”
[Dependency]
public IMembershipService IMemberhipSvcInst { get; set; }
[Dependency]
public IBenchmarkService IBenchmarkSvcInst { get; set; }
#endregion
public DashboardProcess()
{
//Resolving Dependency
IMemberhipSvcInst = DependencyResolver.Current.GetService<IMembershipService>();
}
public bool doBgProcess(Guid userProfileId)
{
if (userProfileId != null && userProfileId != Guid.Empty)
{
IMemberhipSvcInst.GetAllUserEmails();
}
return true;
}