3
Answers

How to count Id

Martin

Martin

1y
689
1

I have a table where i want number of ID with entity framework core. I 'm using CountAsync but it it returning number 26.

But there ID 27. Picture result from querry in Azure Studio. Am I'm doing something wrong?

Example of method:

public async Task<int> GetNumberOfId()
{
    int number = await DB.mytable.CountAsync(); ; 
    return number;
}

Answers (3)