public static IServiceCollection AddMessageFormatter(this IServiceCollection serviceCollection, MessageOptions messageOptions) { return(serviceCollection.AddScoped <IMessageService>(serviceProvider => { return new MessageService(messageOptions); })); }
public MessageService(MessageOptions messageOptions) { _messageOptions = messageOptions; }