This question already has an answer here:
Should I use async if I'm returning a Task and not awaiting anything
I'm just working on generic repository and I found this sample
I've noticed that some of methods return async Task and some just Task.
public virtual Task<bool> GetExistsAsync(Expression<Func<TEntity, bool>> filter = null)
public virtual async Task<TEntity> GetByIdAsync(object id)
return await dbSet.FindAsync(id);
What's the preference? I have read quite a lot about it and I've seen recommendation to await only if I do something else after await keyword -> this would mean that GetByIdAsync shouldn't have async/await but then it won't be asynchronous method.
If it won't be asynchronous method then what's the benefit of returning just Task like in GetExistsAsync?