Exemplo n.º 1
0
 public IEnumerable <E> GetEntities <E>() where E : class, new()
 {
     using (SqlConnection connection = new SqlConnection(connectionString_)) {
         using (SqlCommand sqlCommand = new SqlCommand()) {
             sqlCommand.CommandText = $"SELECT * FROM {typeof(E).Name}";
             using (SqlDataReader reader = ExecuteDataReader(sqlCommand, connection)) {
                 return(EntityMapping.SqlDataReaderToEntityCollection <E>(reader));
             }
         }
     }
 }