Example #1
0
        public ProductController
        (
            UserManager <ApplicationUser> _userManager,
            DbRepository <OnlineMarketContext, Brand, int> _dbBrand,
            DbRepository <OnlineMarketContext, Category, int> _dbCategory,
            DbRepository <OnlineMarketContext, ProductAbstract, int> _dbProductAbstract,
            DbRepository <OnlineMarketContext, AdditionalFeatures, int> _dbAdditionalFeatures,
            DbRepository <OnlineMarketContext, ProductAdditionalFeatures, int> _dbProductAdditionalFeatures,
            DbRepository <OnlineMarketContext, ProductFeature, int> _dbProductFeature,
            DbRepository <OnlineMarketContext, ProductImage, int> _dbProductImage,
            DbRepository <OnlineMarketContext, ProductPrice, int> _dbProductPrice,
            //DBRepositoryEx<OnlineMarketContext, Category, string> _dbCategoryEx,
            IHostingEnvironment _hostingEnvironment,
            IConfiguration configuration,
            OnlineMarketContext db
        )
        {
            userManager                 = _userManager;
            dbBrand                     = _dbBrand;
            dbCategory                  = _dbCategory;
            dbProductAbstract           = _dbProductAbstract;
            dbAdditionalFeatures        = _dbAdditionalFeatures;
            dbProductAdditionalFeatures = _dbProductAdditionalFeatures;
            dbProductFeature            = _dbProductFeature;
            //dbCategoryEx = _dbCategoryEx;
            dbProductImage = _dbProductImage;
            dbProductPrice = _dbProductPrice;
            _db            = db;

            hostingEnvironment = _hostingEnvironment;
            contentRootPath    = hostingEnvironment.ContentRootPath;
            _configuration     = configuration;
        }
        public TokenGenerator(UserManager <ApplicationUser> userManager, OnlineMarketContext db)
        {
            _userManager = userManager;
            _db          = db;
            var expiredTokens = _db.Tokens.Where(x => (DateTime.Now - x.RegDateTime).TotalMinutes > 5 || x.Used == true).ToList();

            if (expiredTokens.Count > 0)
            {
                _db.Tokens.RemoveRange(expiredTokens);
                _db.SaveChanges();
            }
        }
 public ProductController
 (
     UserManager <ApplicationUser> userManager,
     DbRepository <OnlineMarketContext, ProductAbstract, int> dbProduct,
     DbRepository <OnlineMarketContext, Category, int> _dbCategory,
     DbRepository <OnlineMarketContext, ProductAdditionalFeatures, int> _dbProductAdditionalFeatures,
     OnlineMarketContext db
 )
 {
     _userManager = userManager;
     _dbProduct   = dbProduct;
     dbCategory   = _dbCategory;
     dbProductAdditionalFeatures = _dbProductAdditionalFeatures;
     _db = db;
 }
Example #4
0
 public ToolsController
 (
     DbRepository <OnlineMarketContext, ContactUs, int> _dbContactUs,
     DbRepository <OnlineMarketContext, Setting, int> _dbSetting,
     IHostingEnvironment env,
     IConfiguration configuration,
     OnlineMarketContext db
 )
 {
     dbContactUs     = _dbContactUs;
     dbSetting       = _dbSetting;
     this.env        = env;
     _configuration  = configuration;
     contentRootPath = env.ContentRootPath;
     _db             = db;
 }
        public AccountController(
            UserManager <ApplicationUser> userManager,
            SignInManager <ApplicationUser> signInManager,
            IHostingEnvironment hostingEnvironment,
            DbRepository <OnlineMarketContext, Address, int> dbAddress,
            DbRepository <OnlineMarketContext, Invoice, int> _dbInvoice,
            OnlineMarketContext db)
        {
            _userManager   = userManager;
            _signInManager = signInManager;
            _db            = db;

            _dbAddress          = dbAddress;
            dbInvoice           = _dbInvoice;
            _hostingEnvironment = hostingEnvironment;
            contentRootPath     = _hostingEnvironment.ContentRootPath;//returns the root path of the website
        }//end AccountController(Constructor)
Example #6
0
 public HomeController
 (
     UserManager <ApplicationUser> _userManager,
     DbRepository <OnlineMarketContext, ContactUs, int> _dbContactUs,
     DbRepository <OnlineMarketContext, Article, int> _dbArticle,
     DbRepository <OnlineMarketContext, GeneralPage, int> _dbGeneralPage,
     DbRepository <OnlineMarketContext, Banner, int> _dbBanner,
     OnlineMarketContext db
 )
 {
     userManager   = _userManager;
     dbContactUs   = _dbContactUs;
     dbArticle     = _dbArticle;
     dbGeneralPage = _dbGeneralPage;
     dbBanner      = _dbBanner;
     _db           = db;
 }
Example #7
0
        public AccountController(UserManager <ApplicationUser> userManager,
                                 SignInManager <ApplicationUser> signInManager,
                                 RoleManager <IdentityRole> roleManager,
                                 OnlineMarketContext db,
                                 IHostingEnvironment hostingEnvironment,
                                 DbRepository <OnlineMarketContext, UserModified, int> dbUserModified,
                                 DbRepository <OnlineMarketContext, UserImage, int> dbUserImage)
        {
            _userManager   = userManager;
            _signInManager = signInManager;
            _roleManager   = roleManager;
            _db            = db;

            _dbUserModified = dbUserModified;
            _dbUserImage    = dbUserImage;

            _hostingEnvironment = hostingEnvironment;
            contentRootPath     = _hostingEnvironment.ContentRootPath;//returns the root path of the website
        }
Example #8
0
        public Startup(IHostingEnvironment env)
        {
            var builder = new ConfigurationBuilder()
                          .SetBasePath(env.ContentRootPath)
                          .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                          .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
                          .AddEnvironmentVariables();

            using (var db = new OnlineMarketContext())
            {
                db.Database.EnsureCreated();
                db.Database.Migrate();
            }

            if (env.IsDevelopment())
            {
                // This will push telemetry data through Application Insights pipeline faster, allowing you to view results immediately.
                builder.AddApplicationInsightsSettings(developerMode: true);
            }
            Configuration = builder.Build();
        }
 public ResourceRepository(OnlineMarketContext context)
 {
     _context = context;
 }
Example #10
0
 public UserRepository(OnlineMarketContext context)
 {
     _context = context;
 }
Example #11
0
 public DealRepository(OnlineMarketContext context)
 {
     _context = context;
 }