public HomeController(ILogger <HomeController> logger, IWebHostEnvironment environment)
 {
     ctx          = new DBTirelireShopContext();
     repoProduit  = new RepositoryTirelire <Produit>(ctx);
     _logger      = logger;
     _environment = environment;
 }
Exemple #2
0
 public PanierController()
 {
     ctx          = new DBTirelireShopContext();
     repoProduit  = new RepositoryTirelire <Produit>(ctx);
     repoCommande = new RepositoryTirelire <Commande>(ctx);
     repoClient   = new RepositoryTirelire <Client>(ctx);
 }
Exemple #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);
 }
        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);
 }
Exemple #11
0
        public DBTirelireShopContext ctx;  //for the unit test
        // GET: CouleurController

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