Ejemplo n.º 1
0
        private void ConfigurePartnerService(IServiceCollection services)
        {
            services.AddSingleton <IPartnerServiceConfig>(ps => {
                return(new PartnerServiceConfig
                {
                    PartnerServiceUrl = ConfigurationManager.AppSettings["PartnerServiceUrl"],
                    EndpoingBehaviors = new List <IEndpointBehavior> {
                        new MessageLogger()
                    }
                });
            });

            services.AddSingleton <IPartnerServiceProxyFactory, PartnerServiceProxyFactory>();

            services.AddSingleton <IPartnerServiceRepository, PartnerServiceRepository>();
            services.Decorate <IPartnerServiceRepository, PartnerServiceCache>();

            PsMapper.Configure();
        }