(from SN1 in uow.SystemNotifications
 join sn2 in
      (
            from SN2 in uow.SystemNotifications
            select new { SN2.UserId, SN2.NotificationTypeId, SN2.ItemId }
      ).Distinct()
  on new { SN1.UserId, SN1.NotificationTypeId }
  equals new { sn2.UserId, sn2.NotificationTypeId }
  select SN1).ToList();
When I execute this query, Distinct() is not working. It selects all the records in the result of inner query. How to modify this to get distinct rows in the inner query result.
 
    