I have an worker service what will be consumed in two project.
First project use Autofac for dependency injection the other use Microsoft.Extensions.DependencyInjection
First Worker look like:
public class Worker : BackgroundService
{
...
public Worker(
[KeyFilter(ChannelKeys.Name1)]
Channel<Dictionary<string, object>> dataChannel1,
[KeyFilter(ChannelKeys.Name2)]
Channel<Dictionary<string, object>> dataChannel2,
...
)
}
the other same but other attributes:
public Worker(
[FromKeyedServices(ChannelKeys.Name1)]
Channel<Dictionary<string, object>> dataChannel1,
[FromKeyedServices(ChannelKeys.Name2)]
Channel<Dictionary<string, object>> dataChannel2,
...
how to unify that i have only one worker to maintain?
New contributor
user24500090 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.