我应该如何使用 order by on distinct in entities

how should I use order by on distinct in entities

我有这个代码

     var chats = (from c in _entities.Chats
        where c.SenderId == userId || c.ReceiverId == userId

            select new ChatList()
             {
              Logo = c.SenderId != userId ? c.Company.LogoUrl:c.Company1.LogoUrl,
              Name = c.SenderId != userId? c.Company.CompanyPersonName:c.Company1.CompanyPersonName,
            UserId = c.SenderId!=userId ?c.Company.CompanyId : c.Company1.CompanyId 
            }
   ).Distinct();

我应该如何添加,"order by" 像这样:

ORDER BY c.SenderId

在其末尾添加OrderBy

   var chats = (from c in _entities.Chats
    where c.SenderId == userId || c.ReceiverId == userId

        select new ChatList()
         {
          Logo = c.SenderId != userId ? c.Company.LogoUrl:c.Company1.LogoUrl,
          Name = c.SenderId != userId? c.Company.CompanyPersonName:c.Company1.CompanyPersonName,
        UserId = c.SenderId!=userId ?c.Company.CompanyId : c.Company1.CompanyId 
        }
    ).Distinct().OrderBy(x => x.UserId)