//---------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner Microsoft
// @backupowner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects
{
using System;
using System.Collections;
using System.ComponentModel;
///
/// This class implements IEnumerable and IDisposable. Instance of this class
/// is returned from ObjectQuery.Execute method.
///
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
public abstract class ObjectResult : IEnumerable, IDisposable, IListSource
{
internal ObjectResult()
{
}
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumeratorInternal();
}
// ----------------------
// IListSource Properties
// ----------------------
///
/// IListSource.ContainsListCollection implementation. Always returns false.
///
bool IListSource.ContainsListCollection
{
get
{
return false; // this means that the IList we return is the one which contains our actual data, it is not a collection
}
}
// ----------------------
// IListSource method
// ----------------------
///
/// IListSource.GetList implementation
///
///
/// IList interface over the data to bind
///
IList IListSource.GetList()
{
return this.GetIListSourceListInternal();
}
public abstract Type ElementType
{
get;
}
public abstract void Dispose();
///
/// Get the next result set of a stored procedure.
///
///
/// An ObjectResult that enumerates the values of the next result set. null, if there are no more, or if the
/// the ObjectResult is not the result of a stored procedure call.
///
public ObjectResult GetNextResult()
{
return this.GetNextResultInternal();
}
internal abstract IEnumerator GetEnumeratorInternal();
internal abstract IList GetIListSourceListInternal();
internal abstract ObjectResult GetNextResultInternal();
}
}