2
What difference between ToListAsync()
and ToList()
?
As in the example below, what is the difference between one and the other?
using Modelo.Classes.Contexto;
using System.Data.Entity;
using System.Linq;
namespace AppConsoleTestes
{
class Program
{
static void Main(string[] args)
{
using (var ctx = new dbContexto())
{
var ListaUsuario1 = ctx.Usuarios.ToListAsync();
var ListaUsuario2 = ctx.Usuarios.ToList();
}
}
}
}
Damn, I was just finishing writing :(
– Eric Wu
You can post, you have nothing to lose, quite the contrary, if the answer is right, my upvote is guaranteed. This question will serve more people in the future, it is good to have several answers, as long as they are all correct and no copy of the other.
– Jéf Bueno