C#C
C#3y ago
barcode

✅ EFCore LINQ methods

I have this function
    public async Task<IReadOnlyList<Review>> GetByCenterId(uint id, uint page, uint count)
    {
        return await _dbContext.Reviews
            .Where(x => x.CenterId == id)
            .OrderBy(x => x.CreatedAt)
            .Skip((int)(page * count))
            .Take((int)count)
            .ToListAsync();
    }


and naturally pages and count cannot be negative so I use uint, however I must cast it as no Skip or Take method exists for uint, is this the way it should be done or should I use int as parameters?
Was this page helpful?