I have an important question which I couldn't find the answer anywhere! Suppose we call the Count or CountAsync method in EF or EFCore like this:
public async Task<int> Count()
{
return await _context.Set<TEntity>().CountAsync();
}
Does it results to save or add the entities into the database or not?
Thank you.
CodePudding user response:
Does it results to save or add the entities into the database or not?
No. Queries never write to the database. Only SaveChanges writes to the database.