1 //---------------------------------------------------------------------
2 // <copyright file="ObjectResult.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
7 // @backupowner Microsoft
8 //---------------------------------------------------------------------
10 namespace System
.Data
.Objects
13 using System
.Collections
;
14 using System
.ComponentModel
;
17 /// This class implements IEnumerable and IDisposable. Instance of this class
18 /// is returned from ObjectQuery.Execute method.
20 [System
.Diagnostics
.CodeAnalysis
.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
21 public abstract class ObjectResult
: IEnumerable
, IDisposable
, IListSource
23 internal ObjectResult()
27 IEnumerator IEnumerable
.GetEnumerator()
29 return this.GetEnumeratorInternal();
32 // ----------------------
33 // IListSource Properties
34 // ----------------------
36 /// IListSource.ContainsListCollection implementation. Always returns false.
38 bool IListSource
.ContainsListCollection
42 return false; // this means that the IList we return is the one which contains our actual data, it is not a collection
46 // ----------------------
48 // ----------------------
50 /// IListSource.GetList implementation
53 /// IList interface over the data to bind
55 IList IListSource
.GetList()
57 return this.GetIListSourceListInternal();
60 public abstract Type ElementType
65 public abstract void Dispose();
68 /// Get the next result set of a stored procedure.
71 /// An ObjectResult that enumerates the values of the next result set. null, if there are no more, or if the
72 /// the ObjectResult is not the result of a stored procedure call.
74 public ObjectResult
<TElement
> GetNextResult
<TElement
>()
76 return this.GetNextResultInternal
<TElement
>();
79 internal abstract IEnumerator
GetEnumeratorInternal();
80 internal abstract IList
GetIListSourceListInternal();
81 internal abstract ObjectResult
<TElement
> GetNextResultInternal
<TElement
>();