Pregunta

¿El SubSonic 2.2 Apoyo carga lenta? ¿Puedo cargar perezoso una propiedad de un objeto? En caso afirmativo, ¿dónde puedo encontrar información sobre esto?

¿Fue útil?

Solución

Subsonic 2.2 no soporta carga diferida.

Todos los datos cargados en la llamada y inseting en una lista.

Cómo siempre es una buena idea.

Aquí está el punto de que la carga de datos.

    /// <summary>
    /// Loads the collection and leaves the IDataReader open.
    /// </summary>
    /// <param name="dataReader">The data reader.</param>
    public void Load(IDataReader dataReader)
    {
        while(dataReader.Read())
        {
            ItemType item = new ItemType();
            item.Load(dataReader);
            Add(item);
        }
    }
    /// <summary>
    /// Loads the collection by iterating through the rows in the supplied DataTable.
    /// </summary>
    /// <param name="dataTable">The data table.</param>
    public void Load(DataTable dataTable)
    {
        foreach(DataRow dr in dataTable.Rows)
        {
            ItemType item = new ItemType();
            item.Load(dr);
            Add(item);
        }
    }
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top