Partager via


PollingListProvider<TBusinessObject>.GetData Method ()

 

Retrieves business objects and stores them in the ICollection<T> object that is returned.

Namespace:   Microsoft.WindowsServerSolutions.Administration.ObjectModel
Assembly:  Microsoft.WindowsServerSolutions.Administration.ObjectModel (in Microsoft.WindowsServerSolutions.Administration.ObjectModel.dll)

Syntax

protected abstract ICollection<TBusinessObject> GetData()
protected:
virtual ICollection<TBusinessObject>^ GetData() abstract
Protected MustOverride Function GetData As ICollection(Of TBusinessObject)

Return Value

Type: System.Collections.Generic.ICollection<TBusinessObject>

An instance of ICollection<T> that contains the business objects that were retrieved.

Remarks

TBusinessObject represents a business object that encapsulates information and methods that relate to business data or business functionality. The information in the business object is exposed as properties.

The code example for this method shows business objects that are created from a class that uses properties to make information available. Business objects can also be created from other sources, such as databases or services.

Examples

The following code example shows how to override the GetData method and add business objects to the list:

protected override ICollection<BusinessObject> GetData()
{
    List<BusinessObject> list = new List<BusinessObject>();

    BusinessObject businessObj = new BusinessObject();
    businessObj.AdminName = "administrator1";
    businessObj.ComputerName = "Computer1";
    businessObj.Location = "Building 1";
    businessObj.System = "Windows Vista";

    list.Add(businessObj);

    businessObj = new BusinessObject();
    businessObj.AdminName = "administrator2";
    businessObj.ComputerName = "Computer2";
    businessObj.Location = "Building 2";
    businessObj.System = "Windows Vista";

    list.Add(businessObj);

    return list;
}

See Also

PollingListProvider<TBusinessObject> Class
Microsoft.WindowsServerSolutions.Administration.ObjectModel Namespace

Return to top