Skip to content

Instantly share code, notes, and snippets.

Wullems Bart wullemsb

Block or report user

Report or block wullemsb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Program.cs
builder.Configure<EndpointOptions>(options =>
{
// Port to use for Silo-to-Silo
options.SiloPort = 11111;
// Port to use for the gateway
options.GatewayPort = 30000;
// IP Address to advertise in the cluster
options.AdvertisedIPAddress = IPAddress.Parse(config.GetSection("ServerIpAddress").Value);
});
View RegisterDecorator.cs
builder.RegisterDecorator<ILoggerDecorator,ILogger();
View ILoggerDecorator.cs
public class BenchmarkDecorator:ILogger
{
private readonly ILogger _decoratedLogger;
public BenchmarkDecorator(ILogger logger)
{
_decoratedLogger=logger;
}
public async Task LogMessage(string message)
View RegisterConsoleLogger.cs
builder.RegisterType<ConsoleLogger>().As<ILogger>();
View ConsoleLogger.cs
public class ConsoleLogger: ILogger
{
public Task LogInformation(string message)
{
Console.WriteLine(message);
}
}
View AutofacOpenGenericsCorrect.cs
builder.RegisterGeneric(typeof(UnitOfWorkBehavior<,>)).As(typeof(IPipelineBehavior<,>));
View AutofacOpenGenericsWrong.cs
builder.Register(typeof(UnitOfWorkBehavior<,>)).As(typeof(IPipelineBehavior<,>));
You can’t perform that action at this time.