public async Task <IEnumerable <Filiaire> > GetFiliaire() { var query = new GetListGenericQuery <Filiaire>(condition: null, includes: null); var Handler = new GetListGenericHandler <Filiaire>(GenericRepository); return(await Handler.Handle(query, new CancellationToken())); }
public async Task <IEnumerable <Machine> > GetMachineFonctionne() { var query = new GetListGenericQuery <Machine>((x => !(x.etat_machine.Equals("en panne"))), null); var Handler = new GetListGenericHandler <Machine>(GenericRepository); return(await Handler.Handle(query, new CancellationToken())); }
public async Task <IEnumerable <Type_intervention> > GetType_intervention() { var query = new GetListGenericQuery <Type_intervention>(condition: null, includes: null); var Handler = new GetListGenericHandler <Type_intervention>(GenericRepository); return(await Handler.Handle(query, new CancellationToken())); }
public IEnumerable <NbrMachineDTO> GetNombreFournisseurparMachine() { var query = new GetListGenericQuery <Fournisseur>(condition: null, includes: null); var Handler = new GetListGenericHandler <Fournisseur>(GenericRepository); var fournisseurs = Handler.Handle(query, new CancellationToken()).Result.ToList(); var query2 = new GetListGenericQuery <Machine>(condition: null, includes: null); var Handler2 = new GetListGenericHandler <Machine>(MachineRepository); var machines = Handler2.Handle(query2, new CancellationToken()).Result.ToList(); var list = new List <NbrMachineDTO>(); foreach (var fournisseur in fournisseurs) { var nbrmachine = new NbrMachineDTO(); nbrmachine.nbrMachine = machines.Count(x => x.id_fournisseur == fournisseur.id_fournisseur); nbrmachine.label = fournisseur.label; nbrmachine.id_fournisseur = fournisseur.id_fournisseur; list.Add(nbrmachine); } return(list); }