class Program
{
static NorthwindEntities db = new NorthwindEntities();
static void Main(string[] args)
{
Thread t1 = new Thread(S1);
t1.Start();
t1.Join();
Console.WriteLine("Thread t1 BİTTİ");
Thread t2 = new Thread(S2);
t2.Start();
t2.Join();
Console.WriteLine("Thread t2 BİTTİ");
}
//............................................................................................
static void S1()
{
var kat = (from k in db.Categories
from p in db.Products
where k.CategoryID == p.CategoryID
select new {
Kategori = k.CategoryName,
Ürün = p.ProductName
}).OrderBy(k => k.Kategori).ThenBy(u=>u.Ürün).Take(10).ToList();
foreach (var item in kat)
{
Console.WriteLine("TH 1 => Kategori : " + item.Kategori + " .. Ürün : " + item.Ürün);
}
}
//............................................................................................
static void S2()
{
for (int i = 0; i < 10; i++)
{
Console.WriteLine("i => " + i.ToString());
}
}
//............................................................................................
}
Yorumlar
Yorum Gönder