Last active
May 10, 2019 23:33
-
-
Save msajid/b3b7d9224856caed385369d9d30c6b8f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Azure.Functions.Extensions.DependencyInjection; | |
using Microsoft.Extensions.DependencyInjection; | |
[assembly: FunctionsStartup(typeof(AzureFunctionAppWithDIAndScrutor.Startup))] | |
namespace AzureFunctionAppWithDIAndScrutor | |
{ | |
public class Startup : FunctionsStartup | |
{ | |
public override void Configure(IFunctionsHostBuilder builder) | |
{ | |
// builder.Services.AddSingleton<ISomeService, SomeService>(); | |
builder.Services.Scan(scan => scan | |
.FromAssemblyOf<ISomeService>() | |
.AddClasses(classes => classes.AssignableTo<ISomeService>()) | |
.AsImplementedInterfaces() | |
.WithSingletonLifetime()); | |
builder.Services.Decorate<ISomeService, SimpleDecorator>(); | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment