Example #1
0
        protected override IEnumerable <ServiceInstanceListener> CreateServiceInstanceListeners()
        {
            return(new[]
            {
                OrleansServiceInstanceListenerFactory.Get(),

                WebClientFactory.Get(new WebClientFactoryOptions
                {
                    ContentDirectory = (new DirectoryInfo(Directory.GetCurrentDirectory()).Parent?.FullName ?? string.Empty) + "\\Fabric.Web",
                    EndpointName = "Web",
                    LogAction = (ctx, log) => ServiceEventSource.Current.ServiceMessage(ctx, log)
                })
            });
        }
        protected override IEnumerable <ServiceInstanceListener> CreateServiceInstanceListeners()
        {
            var myConfigPackage = Context.CodePackageActivationContext.GetConfigurationPackageObject("Config");

            var fabricSettings = new FabricSettings(myConfigPackage);

            var webFactoryOptions = new WebClientFactoryOptions
            {
                FabricSettings = fabricSettings,
                EndpointName   = "Web",
                LogAction      = (ctx, log) => ServiceEventSource.Current.ServiceMessage(ctx, log),
                ContentRoot    = (new DirectoryInfo(Directory.GetCurrentDirectory()).Parent?.FullName ?? string.Empty) + "\\Fabric.Web"
            };

            return(new[]
            {
                OrleansServiceInstanceListenerFactory.Get(fabricSettings),

                WebClientFactory.Get(webFactoryOptions)
            });
        }