Combine two Linq query results using Union in ASP.Net

Last Reply 7 months ago By pandeyism

Posted 7 months ago

hello,

i have these two queries and i want to apply union operator so i can merge both result in other var merge and then binding it gridview please advice

var s=(from m in db.Messages
       where m.sender==Page.User.Identity.Name
       select new
       {
           ChatID=m.ChatID,
           sender=m.sender
       });

var r=(from m in db.Messages
      where m.recipient == Page.User.Identity.Name
      select new
      {
           ChatID=m.ChatID,
           recipient=m.recipient
      });

 

This question does not have replies that have been liked.