Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

How to get exact number of elements?

$
0
0

Hello,

I am trying to query a table. I want to get only exact size of element but couldn't manage. Buttake gets up to 5 I think.

var gameBankResult = await (context.GameBanks.Where(g => g.productCode == initiate.productCode)
                .Where(l => l.referenceId == null)
                .Take(5)).ToListAsync();

If there are 5 elements which meet the condition, I want to get exact 5 of them.


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>