Q:

Can Any one help me to convert this sql query into linq

I need to convert this SQL Query to Link : 
"Select * FROM [Register] 
 where RegisterId IN (SELECT MyId 
                      FROM Friends 
                      WHERE FriendId='" + Session["CurrentProfileId"] + "' 
                      AND Status=1 

                      UNION 

                      SELECT FriendId 
                      FROM Friends 
                      WHERE MyId='" + Session["CurrentProfileId"] + "' 
                      AND Status=1) ";

It may be look like this??? but this is incorrect and having errors
(from u in db.Register
 where RegisterId).Contains
        (from f in db.Freinds
         where f.MyId == Id && m.Status == 1
         select new { m.MyId })
        .Union(from m in db.Freinds
               where f.FreindId == Id && m.Status == 1
               select new { m.CreateDate } ));

A:

You have a few problems with the linq above and here are a few:

In the query in the Union you select the CreateDate whereas in the top on you select the MyId. I assume you meant to select FreindId.
In these 2 queries you create an anonymous class instance with the field but then compare it to the RegisterId which is probably a guid/string/int - but for sure not of the type you just created.
You are using the Contains method wrong. Linq syntax can be similar to sql but it is not the same. Check here for Contains

The correct Linq way of doing it is:
var idsCollection = ((from f in db.Freinds
                     where f.StatusId == 1 && f.MyId == Id
                     select f.MyId)
                   .Union(from m in db.Friends
                          where m.StatusId == 1 && f.FreindId == Id
                          select m.FriendId)).ToList();

var result = (from u in db.Register
             where idsCollection.Contains(u.RegisterId)
             select u).ToList();

Notice that the .ToList() is not a must and is here just to ease in debugging. For more information about this .ToList() and Linq in general check MSDN

