문제

Does SubSonic 2.2 support lazy loading? Can I lazy load a property of an object? If yes, where can I find info on this?

도움이 되었습니까?

해결책

Subsonic 2.2 Not support lazy loading.

All data loaded on the call and inseting into a list.

How ever is a good idea.

Here is the point that load the data.

    /// <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);
        }
    }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top