Exemplo n.º 1
0
 public ValuesController(
     IEasyCachingProviderFactory providerFactory
     , BDbContext dbContext)
 {
     this._providerFactory = providerFactory;
     this._dbContext       = dbContext;
 }
Exemplo n.º 2
0
        public BController(ILogger <BController> logger, IEasyCachingProviderFactory cacheProviderFactory, BDbContext context)
        {
            _logger = logger;
            _cacheProviderFactory = cacheProviderFactory;
            _dbContext            = context;

            if (_dbContext.Database.EnsureCreated())
            {
                _dbContext.DemoObjs.AddRange(new List <DemeObj>()
                {
                    new DemeObj()
                    {
                        Id = 1, Name = "Jack"
                    },
                    new DemeObj()
                    {
                        Id = 2, Name = "Kobe"
                    },
                    new DemeObj()
                    {
                        Id = 3, Name = "Catcher"
                    },
                });
                _dbContext.SaveChanges();
            }
        }
 public ValuesController(
     IEasyCachingProviderFactory providerFactory
     , BDbContext dbContext
     , IHttpClientFactory clientFactory)
 {
     this._providerFactory = providerFactory;
     this._dbContext       = dbContext;
     this._clientFactory   = clientFactory;
 }