Hi,
I am trying to inject a service through the constructor in WebViewPageBase.cs lying in Web Project -> Views -> WebViewPageBase but its not allowing. Does Dependency Injection through the constructor not work for WebViewPageBase.cs class?
Thanking you in advance.
Hi,
I am new to ASP.Net Zero and ABP.
I have created a custom filter to ignore the rows having IsArchived property set to 1, i.e. true. Everything works fine. It filters out the rows with this column == 1. Now, I want to fetch the rows where IsArchived == 1. I mean, I want to fetch the archived rows now. I tried disabling the custom filter in my controller action, as follows:
public class ArchivedController : Controller
{
private ArchivedAppService archivedAppService;
IUnitOfWorkManager unitOfWorkManager;
public ArchivedController(IUnitOfWorkManager _unitOfWorkManager, ArchivedAppService _archivedAppService)
{
archivedAppService = _archivedAppService;
unitOfWorkManager = _unitOfWorkManager;
}
public ActionResult Index(int id)
{
unitOfWorkManager.Current.DisableFilter("ArchiveFilter"); //Error: "Object reference not set to an instance of an object."
var output = archivedAppService.GetArchived(id);
ArchivedViewModel model = new ArchivedInitiativesViewModel(output);
return View(model);
}
}
The Current property of unitOfWorkManager is null. So, it throws error.
Please tell me what could be the reason. How and where do I set the unit of work?
Thank you in advance!