Skip to content

Add support for keyed service with multiple attributes #108

@nuzolx

Description

@nuzolx

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions