//---------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner jeffders
// @backupOwner avickers
//---------------------------------------------------------------------
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace System.Data.Objects
{
///
/// Defines behavior for implementations of IQueryable that allow modifications to the membership of the resulting set.
///
/// Type of entities returned from the queryable.
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
public interface IObjectSet : IQueryable
where TEntity : class
{
///
/// Notify the set that an object representing a new entity should be added to the set.
/// Depending on the implementation, the change to the set may not be visible in an enumeration of the set
/// until changes to that set have been persisted in some manner.
///
/// Entity object to be added.
void AddObject(TEntity entity);
///
/// Notify the set that an object representing a new entity should be added to the set.
/// Depending on the implementation, the change to the set may not be visible in an enumeration of the set
/// until changes to that set have been persisted in some manner.
///
/// Entity object to be attached.
void Attach(TEntity entity);
///
/// Notify the set that an object representing an entity should be removed from the set.
/// Depending on the implementation, the change to the set may not be visible in an enumeration of the set
/// until changes to that set have been persisted in some manner.
///
/// Entity object to be removed.
/// Throws if the specified object is not in the set.
void DeleteObject(TEntity entity);
///
/// Notify the set that an object representing an entity should be removed from the set.
/// Depending on the implementation, the change to the set may not be visible in an enumeration of the set
/// until changes to that set have been persisted in some manner.
///
/// Entity object to be detached.
void Detach(TEntity entity);
}
}