Sorting of list<object> in ascending and descending order using linq in Asp.net c#
<p>Hello guys I am getting resopnse from web api and storing it on var "obj1". then adding it to list "snap" of object type...i have to perform an operation on "snap" so that list should come in ascending order according to one parameter like "distance"....please help me</p>

<p>here is my code..</p>

<pre><code>List&lt;object&gt; snap = new List&lt;object&gt;();
var obj1 = objEntity.TB_Broadcast_Snap.Where(s =&gt; s.snapid == sid)
                                      .Join(objEntity.TB_User_Registration,
                                            u =&gt; u.userid,
                                            v =&gt; v.userid,
                                            (u, v) =&gt; new { TB_Broadcast_Snap = u, TB_User_Registration = v })
                                      .Select(s =&gt; new
                                      {
                                          s.TB_Broadcast_Snap.snapid,
                                          s.TB_Broadcast_Snap.title,
                                          s.TB_Broadcast_Snap.details,
                                          s.TB_Broadcast_Snap.category,
                                          s.TB_Broadcast_Snap.tag,

                                          s.TB_Broadcast_Snap.broadcastdistance,
                                          s.TB_Broadcast_Snap.images,
                                          s.TB_Broadcast_Snap.latitude,
                                          s.TB_Broadcast_Snap.longitude,
                                          s.TB_Broadcast_Snap.image_detail1,
                                          s.TB_Broadcast_Snap.image_detail2,
                                          s.TB_Broadcast_Snap.image_detail3,
                                          s.TB_Broadcast_Snap.barcode_image,
                                          s.TB_Broadcast_Snap.broadcast_date,
                                          s.TB_Broadcast_Snap.promocode,
                                          snaptitle = s.TB_Broadcast_Snap.title,
                                          s.TB_Broadcast_Snap.broadcasttype,
                                          s.TB_Broadcast_Snap.regionname,
                                          distance = 0,
                                          popcountno = popcount,
                                          issnaped = issnapped,
                                          //Vendor Detail
                                          s.TB_User_Registration.emailid,
                                          address1 = "No address",

                                          s.TB_User_Registration.userid,
                                          s.TB_User_Registration.username,
                                          s.TB_User_Registration.imageurl,
                                          s.TB_User_Registration.business_name,
                                          s.TB_User_Registration.vendortype,
                                          vendorname = s.TB_User_Registration.name,
                                      }).ToList();
snap.AddRange(obj1);
</code></pre>