nuPickers
nuPickers copied to clipboard
Is there a way to inject dependencies into IDotNetSource classes using Autofac?
Hello
I'm using AutoFac in my application to provide dependency management. At the same time i depend heavily on DoNet Typeahead List. The problem is when i registered my Source classes into Autofac container, the dependencies were not resolved?
I tried to replace:
object dotNetDataSource = AppDomain.CurrentDomain.CreateInstanceAndUnwrap(Helper.GetAssembly(this.AssemblyName).FullName, this.ClassName);
in the DotNetDateSource class with:
var type = Helper.GetAssembly(this.AssemblyName).GetType(ClassName); var themesource = DependencyResolver.Current.GetService(type);
I always get null value.
Any one knows why?
I'm also curious if this possible. Currently using service locator to resolve dependencies into a custom nupicker, but I'd prefer to use DI and constructor injection.
I'm not even able to hit the code while using constructor injection. When loading a node in Umbraco with a property using the datatype I get 500 Internal Server Error with the message:
)]}', {"Message":"The requested resource does not support http method 'GET'."}