Orleans.Http
Orleans.Http copied to clipboard
IApplicationPartManager dependency in endporints.MapGrains()?
Hi, I'm planing to split the Http gateway code from orleans silo. Which the gateway server is not a silo, and should only depends on grains interfaces, orleans client, and routes http requests to the background silos. But when I start gateway, it complains IApplicationPartManager not found. Is there any workaround?
Maybe this could work if the IApplicationPartManager was taken from the client's container instead of the silos?
It seems no simple way to do that... I use following code as a workaround, a bit intriguing...
// Application parts
var parts = new ApplicationPartManager();
services.AddSingleton<IApplicationPartManager>(parts);
parts.AddApplicationPart(new AssemblyPart(typeof( IMyGrain ).Assembly));
parts.AddFeatureProvider(new AssemblyAttributeFeatureProvider<GrainInterfaceFeature>());