Blob Provider in Add-ON

Vote:
 

Hi i am creating a add-on and i want to register a new Blob Provider, but i have several problems

1) i cannot use the BlobFactory beacause it in not loading in  the Container

2) i cannot register a new BlobProvider creating a new BlobFactory and adding to the container because it is using the default Blob Provider.

There are some samples how to create a new Blob Provider into a Add-On.

Regards

#91241
Sep 30, 2014 18:38
Vote:
 

1) Are you referring to case when AddOn receives different instance of IoC container? Haven't tested myself.

2) If you take a look at EPiServer.Framework.FrameworkInitialization.InitializeBlobProviders() FileBlobProvider should be registered if no default provider has been specified in configuration. If you however in 1) receive real and the only IoC container - you should be able to switch default blog factory.

But anyway - question is: do you want to swap out default provider or you want to add your provider to the list of providers?

#91249
Sep 30, 2014 21:19
Vote:
 

I want to swap the default provider in an Add-on.

Regards

#109782
Oct 14, 2014 19:14
Vote:
 

Then you should be good by removing current provider and adding new one: (writting without even compiling it :)

var factory = ServiceLocator.Current.GetInstance<BlobFactory>();
factory.UnregisterProvider("default");

factory.RegisterProvider({you provider here});
#109783
Oct 14, 2014 21:55
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.