public HomeController(ILogger <HomeController> logger, IWebHostEnvironment environment)
 {
     ctx          = new DBTirelireShopContext();
     repoProduit  = new RepositoryTirelire <Produit>(ctx);
     _logger      = logger;
     _environment = environment;
 }
Esempio n. 2
0
 public PanierController()
 {
     ctx          = new DBTirelireShopContext();
     repoProduit  = new RepositoryTirelire <Produit>(ctx);
     repoCommande = new RepositoryTirelire <Commande>(ctx);
     repoClient   = new RepositoryTirelire <Client>(ctx);
 }
Esempio n. 3
0
 public AdminController()
 {
     ctx                 = new DBTirelireShopContext();
     repoProduit         = new RepositoryTirelire <Produit>(ctx);
     repoCommande        = new RepositoryTirelire <Commande>(ctx);
     repoDetailsCommande = new RepositoryTirelire <DetailsCommande>(ctx);
     repoClient          = new RepositoryTirelire <Client>(ctx);
 }
 public ProduitController(IWebHostEnvironment environment, UserManager <IdentityUser> userManager)
 {
     ctx          = new DBTirelireShopContext();
     repoProduit  = new RepositoryTirelire <Produit>(ctx);
     repoImage    = new RepositoryTirelire <Image>(ctx);
     repoClient   = new RepositoryTirelire <Client>(ctx);
     _userManager = userManager;
     _environment = environment;
 }
 public AccountController(SignInManager <IdentityUser> signInManager,
                          UserManager <IdentityUser> userManager,
                          RoleManager <IdentityRole> roleManager)
 {
     _signInManager = signInManager;
     _userManager   = userManager;
     _roleManager   = roleManager;
     ctx            = new DBTirelireShopContext();
     repoClient     = new RepositoryTirelire <Client>(ctx);
 }
Esempio n. 6
0
        private DBTirelireShopContext GetDatabaseContext()
        {
            var options = new DbContextOptionsBuilder <DBTirelireShopContext>()
                          .UseInMemoryDatabase(databaseName: "DBTirelireShop")
                          .Options;
            var databaseContext = new DBTirelireShopContext(options);

            databaseContext.Database.EnsureCreated();

            if (databaseContext.Couleur.Count() <= 0)
            {
                for (int i = 0; i <= 2; i++)
                {
                    databaseContext.Couleur.Add(new Couleur()
                    {
                        Couleur1 = couleurs[i]
                    });
                    databaseContext.SaveChanges();
                }
            }
            return(databaseContext);
        }
        // GET: CouleurController

        public CommandeController()
        {
            ctx          = new DBTirelireShopContext();
            repoCommande = new RepositoryTirelire <Commande>(ctx);
        }
        // GET: ImageController

        public ImageController()
        {
            ctx       = new DBTirelireShopContext();
            repoImage = new RepositoryTirelire <Image>(ctx);
        }
 public RepositoryTirelire(DBTirelireShopContext contexte)
 {
     _contexte = contexte;
 }
 public FabricantController()
 {
     ctx           = new DBTirelireShopContext();
     repoFabricant = new RepositoryTirelire <Fabricant>(ctx);
 }
Esempio n. 11
0
        public DBTirelireShopContext ctx;  //for the unit test
        // GET: CouleurController

        public CouleurController()
        {
            ctx         = new DBTirelireShopContext();
            repoCouleur = new RepositoryTirelire <Couleur>(ctx);
        }
Esempio n. 12
0
 public ClientController()
 {
     ctx        = new DBTirelireShopContext();
     repoClient = new RepositoryTirelire <Client>(ctx);
 }