Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
if (reader.HasRows)
{
var time = new Stopwatch();
time.Start();
while (reader.Read())
lstCliente.Add(new Cliente
{
Id = (int)reader["Id"],
Nome = reader["Nome"].ToString(),
DataNascimento = (DateTime)reader["DataNascimento"],
ClienteEspecial = (bool)reader["ClienteEspecial"],
NomeDaMae = reader["NomeDaMae"].ToString(),
QuantidadeFilhos = (byte)reader["QuantidadeFilhos"]
});
time.Stop();
Console.WriteLine("Tempo buscando pelo nome da coluna: {0}", time.Elapsed);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment