class Name
{
public string name { get; set; }
public string EmailAddress { get; set; }
public string Phone { get; set; }
public Name(string n,string e,string p)
{
name = n;
EmailAddress = e;
Phone = p;
}
}
class EmailAddress
{
public string Name { get; set; }
public string Address { get; set; }
public EmailAddress(string n, string e)
{
Name = n;
Address = e;
}
}
class Temp
{
public string Address { get; set; }
public string Phone { get; set; }
public Temp(string a, string p)
{
Address = a;
Phone = p;
}
}
class Program
{
static void Main(string[] args)
{
EmailAddress[] addrs ={
new EmailAddress("Sheeban","Sheeban@quntech.com"),
new EmailAddress("Ahmed","Ahmed@quntech.com"),
new EmailAddress("Memon","Memon@quntech.com")
};
Name[] name ={
new Name("Sheeban","Sheeban@quntech.com","555-555-555"),
new Name("Ahmed","Ahmed@quntech.com","111-111-111"),
new Name("Memon","Memon@quntech.com","777-777-777")
};
var eAddrs = from entry in addrs
join detail in name
on entry.Name equals detail.name
select new Temp(entry.Address,detail.Phone);
foreach (Temp t in eAddrs)
Console.WriteLine("{0}\t{1}",t.Address,t.Phone);
Console.ReadLine();
}
}
No comments:
Post a Comment