Fills an instance of a class that implements the
IList
interface with all objects (found in the storage) of the given type.
Syntax
| Visual Basic (Declaration) | |
|---|
Overloads Public Overridable Function GetObjectList(Of T)( _
ByVal list As IList(Of T) _
) As IList(Of T) |
| Visual Basic (Usage) | Copy Code |
|---|
Dim instance As ObjectContext
Dim list As IList(Of T)
Dim value As IList(Of T)
value = instance.GetObjectList(Of T)(list)
|
| C# | |
|---|
public virtual IList<T> GetObjectList<T>(
IList<T> list
) |
| Managed Extensions for C++ | |
|---|
public: virtual IList<T>* GetObjectList<T>(
IList<T>* list
) |
| C++/CLI | |
|---|
public:
virtual IList<T>^ GetObjectListgeneric<typename T>
(
IList<T>^ list
) |
Parameters
- list
- An instance of a class that implements the IList
interface.
Type Parameters
- T
Return Value
The instance of a class that implements the
IList
interface.
Example
The following example introduces to the use of the GetObjectList routine.
| C# | Copy Code |
|---|
// Creates a new ObjectContext that uses an MsSql Server as storage. ObjectContext context = new ObjectContext(new MsSqlStorage("sa", "", "localhost", "application")); // ... Other code. // Gets all object matching the name and sorting them by name. IList<User%gt; userList = null; userList = context.GetObjectReader<User>(new List<User>()); // Loop through all items and do something. foreach(User user in userList) { // Do something. } |
Remarks
Requirements
Platforms: Windows 2000, Windows XP family, Windows Server 2003 family, Windows Vista family
See Also