code_junkie

Using Linq with WCF

Nov 11th, 2011
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. static void Main(string[] args)
  2. {
  3. var context=new WebDataContext("http://localhost:18752/Northwind.svc");
  4.  
  5. var query = from p in context.CreateQuery<Product>("Products")
  6. where p.UnitsInStock > 100
  7. select p;
  8.  
  9. foreach (Product p in query)
  10. {
  11. Console.WriteLine(p.ProductName+", UnitsInStock="+p.UnitsInStock);
  12. }
  13. }
Add Comment
Please, Sign In to add comment