Skip to content

Instantly share code, notes, and snippets.

@vmussak
Created July 24, 2018 00:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vmussak/569ba1e59d9abf113cb82d7e88ff30b9 to your computer and use it in GitHub Desktop.
Save vmussak/569ba1e59d9abf113cb82d7e88ff30b9 to your computer and use it in GitHub Desktop.
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