Dependency injection, inject with parameters

前端 未结 5 1590
盖世英雄少女心
盖世英雄少女心 2020-12-08 03:48

I\'m using vNext implementation of DI. How to pass parameters to constructor? For example, i have class:

public class RedisCacheProvider : ICacheProvider
{
         


        
5条回答
  •  借酒劲吻你
    2020-12-08 04:43

    A bit late to the party, but you could DI inject a factory that creates and exposes an instance of your provider class.

提交回复
热议问题