title: How do I return a SQL VIEW in a list
body: <p>I made a code returning to a list via a procedure and it worked, but now I need to return a list of a view 
  *SQL Server</p>
  
  <p>My code:</p>
  
  <pre><code>public List&lt;Ticket&gt; GetTicket()
  {
      List&lt;Ticket&gt; ticketList = new List&lt;Ticket&gt;();
  
      using (_con = new SqlConnection(_connectionString))
      {
          using (SqlCommand command = new SqlCommand("select * from MyView", _con))
          {
              command.CommandType = CommandType.TableDirect;
  
              _con.Open();
  
              SqlDataReader reader = command.ExecuteReader();
              // reader.Load(command.ExecuteReader());
  
              while (reader.Read())
              {
                  Ticket ticket = new Ticket()
                  {
                      //TicketNumber = Convert.ToInt32(reader["numeroTicket"]),
                      Priority= Convert.ToString(reader["tpr_txt_prioridade"]),
                      Status = Convert.ToString(reader["status_descri"]),
                      Client = Convert.ToString(reader["cliente"]),
                      Topic = Convert.ToString(reader["topico"]),
                      Responsible= Convert.ToString(reader["usuario_responsavel"]),
                      OpenDate = Convert.ToDateTime(reader["dt_int"]),
                      LastInteraction= Convert.ToDateTime(reader["tkt_dat_prazo"])
                  };
  
                  ticketList.Add(ticket);
              }
              return ticketList;
          }
      }
  }
  </code></pre>