jeudi 11 juin 2020

MVC Linq .Random() wrong syntax

Hello guys I have some problem with this code but not find something similar in knowledgeBase:

@foreach (var prodotti in contesto.Prodotti.Where(x => x.ProdottoVisibile == true).OrderByDescending(x => x.ProdottoID).Random().Take(5))

it seems .Random() is not working, should i have to manage differently ? of course YES, but how? anyone can give me an tips? thx a lot!




Aucun commentaire:

Enregistrer un commentaire