public void ConfigureServices(IServiceCollection services) { services.AddDbContext <AppDBContent>(options => options.UseSqlServer(_confSting.GetConnectionString("DefaultConnection"))); services.AddTransient <IALLDishes, DishesRepository>(); services.AddTransient <IDeshesCategory, CategoryRepository>(); //services.AddTransient<IALLDishes, MockDishes>(); //services.AddTransient<IDeshesCategory, MockCategory>(); services.AddSingleton <IHttpContextAccessor, HttpContextAccessor>(); services.AddScoped(sp => ShopDisher.GetDisher(sp)); services.AddMvc(); services.AddMemoryCache(); services.AddSession(); }
public ShopDisherController(IALLDishes dishesRep, ShopDisher shopDisher) { _dishesRep = dishesRep; _shopDisher = shopDisher; }