Show / Hide Table of Contents

Class CollectionAdapter<TEntityImplementation, TEntity>

An entity collection adapter.

Inheritance
System.Object
CollectionAdapter<TEntityImplementation, TEntity>
Implements
System.Collections.Generic.ICollection<TEntity>
System.Collections.Generic.IEnumerable<TEntity>
System.Collections.IEnumerable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Data.Adapters
Assembly: Kephas.Data.dll
Syntax
public class CollectionAdapter<TEntityImplementation, TEntity> : ICollection<TEntity>, IEnumerable<TEntity>, IEnumerable where TEntityImplementation : TEntity
Type Parameters
Name Description
TEntityImplementation

Type of the entity implementation.

TEntity

Type of the entity.

Remarks

It assumes that even if exposed through an interface, all items in the collection are of type TEntityImplementation.

Constructors

| Improve this Doc View Source

CollectionAdapter(ICollection<TEntityImplementation>)

Initializes a new instance of the CollectionAdapter<TEntityImplementation, TEntity> class.

Declaration
public CollectionAdapter(ICollection<TEntityImplementation> collectionImplementation)
Parameters
Type Name Description
System.Collections.Generic.ICollection<TEntityImplementation> collectionImplementation

The collection implementation.

Properties

| Improve this Doc View Source

Count

Gets the number of elements contained in the System.Collections.Generic.ICollection<T>.

Declaration
public int Count { get; }
Property Value
Type Description
System.Int32

The number of elements contained in the System.Collections.Generic.ICollection<T>.

| Improve this Doc View Source

IsReadOnly

Gets a value indicating whether the System.Collections.Generic.ICollection<T> is read-only.

Declaration
public bool IsReadOnly { get; }
Property Value
Type Description
System.Boolean

true if the System.Collections.Generic.ICollection<T> is read-only; otherwise, false.

Methods

| Improve this Doc View Source

Add(TEntity)

Adds an item to the System.Collections.Generic.ICollection<T>.

Declaration
public void Add(TEntity item)
Parameters
Type Name Description
TEntity item

The object to add to the System.Collections.Generic.ICollection<T>.

Exceptions
Type Condition
System.NotSupportedException

The System.Collections.Generic.ICollection<T> is read-only.

| Improve this Doc View Source

Clear()

Removes all items from the System.Collections.Generic.ICollection<T>.

Declaration
public void Clear()
Exceptions
Type Condition
System.NotSupportedException

The System.Collections.Generic.ICollection<T> is read-only.

| Improve this Doc View Source

Contains(TEntity)

Determines whether the System.Collections.Generic.ICollection<T> contains a specific value.

Declaration
public bool Contains(TEntity item)
Parameters
Type Name Description
TEntity item

The object to locate in the System.Collections.Generic.ICollection<T>.

Returns
Type Description
System.Boolean

true if item is found in the System.Collections.Generic.ICollection<T>; otherwise, false.

| Improve this Doc View Source

CopyTo(TEntity[], Int32)

Copies the elements of the System.Collections.Generic.ICollection<T> to an System.Array, starting at a particular System.Array index.

Declaration
public void CopyTo(TEntity[] array, int arrayIndex)
Parameters
Type Name Description
TEntity[] array

The one-dimensional System.Array that is the destination of the elements copied from System.Collections.Generic.ICollection<T>. The System.Array must have zero-based indexing.

System.Int32 arrayIndex

The zero-based index in array at which copying begins.

Exceptions
Type Condition
System.ArgumentNullException

array is null.

System.ArgumentOutOfRangeException

arrayIndex is less than 0.

System.ArgumentException

The number of elements in the source System.Collections.Generic.ICollection<T> is greater than the available space from arrayIndex to the end of the destination array.

| Improve this Doc View Source

GetEnumerator()

Returns an enumerator that iterates through the collection.

Declaration
public IEnumerator<TEntity> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<TEntity>

An enumerator that can be used to iterate through the collection.

| Improve this Doc View Source

Remove(TEntity)

Removes the first occurrence of a specific object from the System.Collections.Generic.ICollection<T>.

Declaration
public bool Remove(TEntity item)
Parameters
Type Name Description
TEntity item

The object to remove from the System.Collections.Generic.ICollection<T>.

Returns
Type Description
System.Boolean

true if item was successfully removed from the System.Collections.Generic.ICollection<T>; otherwise, false. This method also returns false if item is not found in the original System.Collections.Generic.ICollection<T>.

Exceptions
Type Condition
System.NotSupportedException

The System.Collections.Generic.ICollection<T> is read-only.

Explicit Interface Implementations

| Improve this Doc View Source

IEnumerable.GetEnumerator()

Returns an enumerator that iterates through a collection.

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
System.Collections.IEnumerator

An System.Collections.IEnumerator object that can be used to iterate through the collection.

Implements

System.Collections.Generic.ICollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable

Extension Methods

DynamicObjectExtensions.SetPropertyValue(Object, String, Object)
DynamicObjectExtensions.TrySetPropertyValue(Object, String, Object)
DynamicObjectExtensions.GetPropertyValue(Object, String)
DynamicObjectExtensions.TryGetPropertyValue(Object, String, out Object)
DynamicObjectExtensions.GetRuntimeTypeInfo(Object)
DynamicObjectExtensions.ToDynamic(Object)
DynamicObjectExtensions.ToExpando(Object)
BehaviorValue.ToBehaviorValue<TValue>(TValue)
CollectionExtensions.AddRange<T, TItem>(T, IEnumerable<TItem>)
EnumerableExtensions.ForEach<T>(IEnumerable<T>, Action<T>)
LoggingExtensions.GetLogger(Object, IContext)
TypeExtensions.GetAbstractType(Object)
TypeExtensions.GetAbstractTypeInfo(Object)
ReflectionHelper.GetTypeInfo(Object)
EntityEntryExtensions.TryGetAttachedEntityEntry(Object)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX