I have got the following interface definition:
public interface ICommandHandler
{
ILogger Logger { get; set; }
bool SendAsync { get; set; }
}
.DependsOn(Proprerty.ForKey("sendAsync").Eq(true))
or with anonymous type
.DependsOn(new{ sendAsync = true })
regarding updated question, it seeems what you need is along the following lines:
container.Register(AllTypes.FromThisAssembly()
.BasedOn(typeof(ICommandHandler<>))
.WithService.Base()
.Configure(c => c.DependsOn(new{ sendAsync = true })
.Lifestyle.Transient));
That way you register and configure all handlers in one go, and as you add new ones you won't have to go back to add them to registration code.
I suggest reading through the documentation as there's much more to the convention-based registration API than this.