I've used the models builder to generate the document types as models within the solution, setting the config to "LiveAppData"
I've set some as compositions, so I can then inject them in custom services, as there are generated as interfaces as well.
When injecting these into a custom service, I get following error:
Boot failed: Umbraco cannot run. See Umbraco's log file for more details.
-> Umbraco.Core.Exceptions.BootFailedException: Boot failed.
-> System.InvalidOperationException: Unable to resolve type: Umbraco.Core.Composing.ComponentCollection, service name: at LightInject.ServiceContainer.CreateDelegate(Type serviceType, String serviceName, Boolean throwError) at LightInject.ServiceContainer.CreateDefaultDelegate(Type serviceType, Boolean throwError) at LightInject.ServiceContainer.GetInstance(Type serviceType) at Umbraco.Core.FactoryExtensions.GetInstance[T](IFactory factory) at Umbraco.Core.Runtime.CoreRuntime.Boot(IRegister register, DisposableTimer timer)
...
-> System.InvalidOperationException: Unresolved dependency [Target Type: Services.Excel.GraphService], [Parameter: microsoftGraphApi(Umbraco.Web.PublishedModels.IMicrosoftGraphApicomposition)], [Requested dependency: ServiceType:Umbraco.Web.PublishedModels.IMicrosoftGraphApicomposition, ServiceName:]
at LightInject.ServiceContainer.GetEmitMethodForDependency(Dependency dependency)
at LightInject.ServiceContainer.EmitConstructorDependency(IEmitter emitter, Dependency dependency)
at LightInject.ServiceContainer.EmitConstructorDependencies(ConstructionInfo constructionInfo, IEmitter emitter, Action`1 decoratorTargetEmitter)
at LightInject.ServiceContainer.EmitNewInstanceUsingImplementingType(IEmitter emitter, ConstructionInfo constructionInfo, Action`1 decoratorTargetEmitMethod)
at LightInject.ServiceContainer.EmitNewInstance(ServiceRegistration serviceRegistration, IEmitter emitter)
at LightInject.ServiceContainer.<>c__DisplayClass153_0.<CreateEmitMethodWrapper>b__0(IEmitter ms)
at LightInject.ServiceContainer.<>c__DisplayClass153_0.<CreateEmitMethodWrapper>b__0(IEmitter ms)
at LightInject.ServiceContainer.EmitConstructorDependency(IEmitter emitter, Dependency dependency)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
In previous versions, I would get the data of the page via the interface, through a generic class where it gets the Id as well - the Umbraco 8 version of that code also threw the same error as above.
Is there a way for me to successfully inject these interfaces and use them in my custom service class?
As a workaround, I'm using the Concrete model and getting the path based on the alias of the document type to get the values of the item:
var publishedContent = Umbraco.Web.Composing.Current.UmbracoHelper.ContentSingleAtXPath("//"+MicrosoftGraphApi.ModelTypeAlias);
var microsoftGraphApisettings = new MicrosoftGraphApi(publishedContent);
Injecting Models Builder generated Models
Hi,
I've used the models builder to generate the document types as models within the solution, setting the config to "LiveAppData"
I've set some as compositions, so I can then inject them in custom services, as there are generated as interfaces as well.
When injecting these into a custom service, I get following error:
In previous versions, I would get the data of the page via the interface, through a generic class where it gets the Id as well - the Umbraco 8 version of that code also threw the same error as above.
Is there a way for me to successfully inject these interfaces and use them in my custom service class?
I'm injecting as the following:
Thanks
As a workaround, I'm using the Concrete model and getting the path based on the alias of the document type to get the values of the item:
is working on a reply...