select top 3 from [dbo.Users] where id in (select id from [dbo.Topics] where userid = 1) order by lastactivetime
var query = db.Topics.Where(x => x.userid == 1).SelectMany(x => db.Users.Where(y => y.id == x.userid)).OrderBy(x => x.lastactivetime).Take(3);