I have Stateful Service fabric service which has the below constructor.
public StatefuleService(StatefulServiceContext context, IReliableStateManagerReplica manager,
IActorProxyFactory actorProxyFactory = null)
: base(context, manager)
{
ActorProxyFactory = actorProxyFactory ?? new ActorProxyFactory();
}
I'm using Autofac to register the components. How can I register IReliableStateManagerReplica using Autofac? I tried
builder.RegisterType<ReliableStateManager>().As<IReliableStateManagerReplica>().SingleInstance;
but it gives the following exception:
None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'Microsoft.ServiceFabric.Data.ReliableStateManager' can be invoked with the available services and parameters: Cannot resolve parameter 'System.Fabric.StatefulServiceContext serviceContext' of constructor 'Void .ctor(System.Fabric.StatefulServiceContext, Microsoft.ServiceFabric.Data.ReliableStateManagerConfiguration)'.