You can use an interface as targetType, so those entities that implements such interface will be injected with your instance type (note: you can set additional interfaces in Entity Editor in LLBLGen Designer at Output Info Tab). For instance:
Implementation of the interface in desire entities. You can set such interface on LLBLGen Designer ([urldescription="ref..."]):
public Entity CustomerEntity : IEntityStrategyBasic
{
....
}
public Entity ProductEntity : IEntityStrategyBasic
{
....
}
Then you setup the DI info in your instance classes:
[DependencyInjectionInfo(typeof(IEntityStrategyBasic), "DiscountStratergy",
ContextType = DependencyInjectionContextType.NewInstancePerTarget,
TargetNamespaceFilter = "Northwind")]
public class MyStrategy1 : IStrategy
{
// ....
}
[DependencyInjectionInfo(typeof(OrderEntity), "DiscountStratergy",
ContextType = DependencyInjectionContextType.NewInstancePerTarget,
TargetNamespaceFilter = "Northwind")]
public class MyStrategy2 : IStrategy
{
// ....
}
In above example, CustomerEntity and ProductEntity will be injected with MyStrategy1. However OrderEntity's DiscountStrategy property will be injected with MyStrategy2.
You can read more about that in the documentation. ReferenceManual doesn't have that examples and instructions, but can download it from LLBLGen Site -> Customer's Area.