This is possible since EF Core 6:
Context.topics.Where(//some logic).OrderBy(e => EF.Functions.Random()).Take(6);
it's in the package
Microsoft.EntityFrameworkCore
Source: https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-6.0/whatsnew#effunctionsrandom