jeudi 8 février 2018

Whats the name of the pattern where you add "functionality"/properties to a class?

I'm on thin ice her... but I've seen it around. Classes that take implementations as addition to its class. Like IServiceCollection if you've used dotnet core.

Something like:

    protected virtual void ConfigureApplicationServices(IServiceCollection services)
    {
        services
            .AddSingleton<IHttpContextAccessor, HttpContextAccessor>()
            .AddScoped<ISignInManager, GeneratedPasswordSignInManager>()
            .AddScoped<IUserManager, GeneratedPasswordUserManager>()
            ...

Where instead of AddScoped I would use SetProperty.

Aucun commentaire:

Enregistrer un commentaire