Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for keyed service with multiple attributes #108

Open
nuzolx opened this issue Apr 30, 2024 · 0 comments
Open

Add support for keyed service with multiple attributes #108

nuzolx opened this issue Apr 30, 2024 · 0 comments

Comments

@nuzolx
Copy link

nuzolx commented Apr 30, 2024

Hi,

I'd like to be able to specify the attribute several times in the case of keyed service.
Is this possible?
At the moment, error ‘CS0579’ is being thrown.

public interface INotificationService
{
    string Notify(string message);
}

[Service<string>("sms")]
public class SmsNotificationService : INotificationService
{
    public string Notify(string message) => $"[SMS] {message}";
}

[Service<string>("email")]
[Service<string>("default")]
public class EmailNotificationService : INotificationService
{
    public string Notify(string message) => $"[Email] {message}";
}

Back this issue
Back this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant