usage setlocatorprovider in VB9

Jun 7, 2010 at 9:53 AM

Hi,

If you want to initialize the servicelocator you need to set something like this in C#

UnityServiceLocator locator = new UnityServiceLocator(ConfigureUnityContainer());
ServiceLocator.SetLocatorProvider(() => locator);

How do you define this in VB9?

I have already tried something like this

ServiceLocator.SetLocatorProvider(Function() locator) 

But i get an compile error: expression doesn't return a value

 

Kind regards