public class ExchangerProvider
{
public static IEnumerable<Robofollower.Exchanger> LikesList(int userId)
{
using (var context = new DataClassesDataContext())
{
return context.Exchanger
.Where(e => e.UserId != userId)
.Where(e => e.LikeActive)
.Where(e => e.Points >= 1)
.Where
(e =>
context.LikeExchanger_Data
.Where(l => l.UserId == userId)
.All(l => l.MediaId != e.MediaId)
)
.OrderByDescending(e => e.Points)
.Take(5)
.ToList();
}
}
}