Closed jbarber2016 closed 6 years ago
You can do the following:
builder.RegisterType<ServiceProxyFactory>().As<IServiceProxyFactory>();
builder.Register<IMyService>(c =>
{
var factory = c.Resolve<IServiceProxyFactory>();
return factory.CreateServiceProxy<IMyService>(new Uri("fabric:/MyApplication/MyHelloWorldService"), new ServicePartitionKey(0));
});
Thanks for jumping in @J-McElroy 👍
I have a stateless service (web api) that talks to stateful service over remoting. On the stateful service I register with autofac, and same goes for the stateless. However one of the ways to communicate to the stateful service is remoting, is there some way using autofac to locate services instead of me having to write the following code?
IMyService helloWorldClient = ServiceProxy.Create(new Uri("fabric:/MyApplication/MyHelloWorldService"));
string message = await helloWorldClient.HelloWorldAsync();