Bonjour.
j'ai des difficultes avec la methode List. comment ramener la valeur List.
je comprend pas bien.
je vous donne mon code:
je sais bien utilise les autres methode public string/int/bool qui te ramene (return valeur string/int ot bool).
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 public class northwindService : InorthwindService { northwindEntities db = new northwindEntities(); public List<MonProduct> GetAllProductByCathegorie() { var ListProduct = from p in db.Products where p.Category.CategoryID == p.CategoryID select new MonProduct { ProduitId =p.ProductID, ProduiName= p.ProductName }; return ListProduct.ToList(); } } class MonProduct { public int ProduitId { get; set; } public string ProduiName { get; set; } }
Mais j'ai des difficulte avec List surtout avec linq to sql.
je sais meme pas comment je vais appeler ma methode GetAllProductByCathegorie dans mon code.
j'ai besoin d'explication ou d'un tutorial pour sa merci.
Cordialement
solaar
Partager