예제 #1
0
        static void Main(string[] args)
        {
            try
            {
                ContextFluent context = new ContextFluent();
                Produit       p       = new Produit(452, "je suis le produit", "je suis la description", true, 45, 0.45, new Categorie("dat cat", true));
                context.Produits.Add(p);
                context.SaveChanges();
                List <Produit> list = context.Produits.ToList();

                foreach (Produit c in list)
                {
                    Console.WriteLine("yo:");
                    Console.WriteLine(c.Libelle);
                    Console.WriteLine(c.Categorie.Libelle);
                }

                Console.WriteLine("c'est ok!");
                Console.ReadLine();
            }
            catch (Exception ex)
            {
                Console.WriteLine("il y a une erreur");
                Console.ReadLine();
            }
        }
예제 #2
0
        // permet de tester EF avec les l'API Fluent
        public static void TestEFAvecFluent()
        {
            // test du contexte avec api fluent
            ContextFluent contextFluent = new ContextFluent();

            // ajout d'un nouveau client avec un compte
            List <ModeleFluent.CompteClient> comptes = new List <ModeleFluent.CompteClient>();

            comptes.Add(new ModeleFluent.CompteClient {
                NomBanque = "CA", NumeroCompte = "1234"
            });
            contextFluent.Clients.Add(new ModeleFluent.Client {
                Nom = "TEST", Comptes = comptes
            });
            contextFluent.SaveChanges();

            // lecture des clients
            List <ModeleFluent.Client> mesAutresClients = contextFluent.Clients.Include(c => c.Comptes).ToList();

            Console.WriteLine("Liste de mes clients avec Fluent : ");
            foreach (ModeleFluent.Client c in mesAutresClients)
            {
                Console.WriteLine("Client n°{0} : {1}", c.Id, c.Nom);
                foreach (ModeleFluent.CompteClient cc in c.Comptes)
                {
                    Console.WriteLine("|__ Compte n°{0}", cc.NumeroCompte);
                }
            }
            Console.WriteLine("...Fin...");
        }
예제 #3
0
 static void Main(string[] args)
 {
     try{
         ContextFluent context = new ContextFluent();
         context.SaveChanges();
     }
     catch (Exception e)
     {
     }
 }
예제 #4
0
        static void Main(string[] args)
        {
            Console.WriteLine("CREATE a DATABASE !!!");

            ContextFluent contextFluent = new ContextFluent();

            contextFluent.Employes.ToList();

            Console.WriteLine("END OF CREATE a DATABASE !!!");
            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            ContextFluent context = new ContextFluent();

            context.Employees.ToList();
            Offer o = new Offer();

            o.Description = "testeteehjed";
            o.Salary      = 3000000;
            o.Title       = "testtt";
            o.Responsible = "ptgrprtg";
            o.Date        = DateTime.Today;
            context.Offers.Add(o);
            //context.SaveChanges();
        }
예제 #6
0
 public Manager()
 {
     contexte = new ContextFluent();
 }
 public StatusCommand(ContextFluent context)
 {
     this._context = context;
 }
예제 #8
0
 public ClientQuery(ContextFluent contexte)
 {
     _contexte = contexte;
 }
예제 #9
0
 public CommandeCommand(ContextFluent contexte)
 {
     _contexte = contexte;
 }
예제 #10
0
 public CommandeQuery(ContextFluent contexte)
 {
     _contexte = contexte;
 }
예제 #11
0
        static void Main(string[] args)
        {
            ContextFluent context = new ContextFluent();

            context.Clients.ToList();
        }
예제 #12
0
 public ProduitQuery(ContextFluent contexte)
 {
     _contexte = contexte;
 }
예제 #13
0
 public ProduitCommand(ContextFluent contexte)
 {
     this.contexte = contexte;
 }
예제 #14
0
 public FormationQuery(ContextFluent context)
 {
     _context = context;
 }
예제 #15
0
 public StatutQuery(ContextFluent contexte)
 {
     this.contexte = contexte;
 }
 public EmployeeQuery(ContextFluent context)
 {
     _context = context;
 }
예제 #17
0
 public Service()
 {
     DbContext = new ContextFluent();
 }
예제 #18
0
 /// <summary>
 /// The constructor!
 /// </summary>
 private Manager()
 {
     _context = new ContextFluent();
 }
예제 #19
0
 public ClientQuery(ContextFluent contexte)
 {
     this.contexte = contexte;
 }
예제 #20
0
 public CategorieQuery(ContextFluent contexte)
 {
     this.contexte = contexte;
 }
 public LogProduitCommand(ContextFluent contexte)
 {
     _contexte = contexte;
 }
예제 #22
0
 public StatusQuery(ContextFluent context)
 {
     _context = context;
 }
 public PostulationQuery(ContextFluent context)
 {
     _context = context;
 }
예제 #24
0
 public StatutCommand(ContextFluent contexte)
 {
     this.contexte = contexte;
 }
예제 #25
0
 public CategorieCommand(ContextFluent contexte)
 {
     _contexte = contexte;
 }
예제 #26
0
 public OfferCommand(ContextFluent context)
 {
     this._context = context;
 }
 public FormationCommand(ContextFluent context)
 {
     this._context = context;
 }
 public PostulationCommand(ContextFluent context)
 {
     this._context = context;
 }
예제 #29
0
 public CommandeCommand(ContextFluent contexte)
 {
     this.contexte = contexte;
 }
예제 #30
0
 public CommandeProduitQuery(ContextFluent contexte)
 {
     _contexte = contexte;
 }