implement dense rank with linq

Using the following linq code, how can I add dense_rank to my results? If that’s too slow or complicated, how about just the rank window function? var x = tableQueryable .Where(where condition) …