Esempio n. 1
0
        public AdvertisementController(ColibriDbContext colibriDbContext,
                                       HostingEnvironment hostingEnvironment,
                                       IStringLocalizer <AdvertisementController> localizer)
        {
            _colibriDbContext   = colibriDbContext;
            _hostingEnvironment = hostingEnvironment;
            _localizer          = localizer;

            // initialize the Constructor for the ProductsController
            ProductsViewModel = new ProductsViewModel()
            {
                CategoryGroups = _colibriDbContext.CategoryGroups.ToList(),
                CategoryTypes  = _colibriDbContext.CategoryTypes.ToList(),
                Products       = new Models.Products()
            };

            // Advertisement ViewModel
            AdvertisementViewModel = new AdvertisementViewModel
            {
                // initialize
                Products = new List <Products>(),
                Users    = new List <ApplicationUser>()
            };

            // ProductsRatingModel
            ProductsRatingViewModel = new ProductsRatingViewModel()
            {
                Products = new List <ProductsRatings>(),
                Product  = new Models.ProductsRatings(),
                Users    = new List <ApplicationUser>()
            };
        }
Esempio n. 2
0
        public ProductsRatingController(ColibriDbContext colibriDbContext,
                                        IStringLocalizer <ProductsRatingController> localizer)
        {
            _colibriDbContext = colibriDbContext;
            _localizer        = localizer;

            ProductsRatingViewModel = new ProductsRatingViewModel()
            {
                Products = new List <ProductsRatings>(),
                Product  = new Models.ProductsRatings(),
                Users    = new List <ApplicationUser>()
            };
        }