How to rewrite the SQL queries to LINQ?

1)
SELECT * FROM (SELECT DISTINCT ON (user_id) * FROM images ORDER BY user_id, post_date) AS images WHERE images.user_id = "1" ORDER BY images.post_date DESC;

2)
SELECT users.id, login, images.name, path FROM users, images WHERE users.id = images.told us AND images.fromId = 1 OR users.id = images.fromId AND images.told us = 1;

The second query is syntactically simplified.That is, instead of LEFT JOIN images ON users.id = images.told us
Use WHERE users.id = images.told us
March 19th 20 at 08:47
0 answer

Find more questions by tags Entity FrameworkLINQASP.NET