DelegatingEnumerable<TWrapped, TDeclared> Class

Summary

Serializes [System.Collections.Generic.IEnumerable`1]() types by delegating them through a concrete implementation.

Inheritance Hierarchy

  • System.Object
  • Microsoft.AspNet.Mvc.Xml.DelegatingEnumerable<TWrapped, TDeclared>

Syntax

public class DelegatingEnumerable<TWrapped, TDeclared> : IEnumerable<TWrapped>, IEnumerable

GitHub

View on GitHub

Microsoft.AspNet.Mvc.Xml.DelegatingEnumerable<TWrapped, TDeclared>

Constructors

Microsoft.AspNet.Mvc.Xml.DelegatingEnumerable<TWrapped, TDeclared>.DelegatingEnumerable()

Initializes a [Microsoft.AspNet.Mvc.Xml.DelegatingEnumerable`2](Microsoft.AspNet.Mvc.Xml.DelegatingEnumerable`2.yml).

public DelegatingEnumerable()
DelegatingEnumerable(System.Collections.Generic.IEnumerable<TDeclared>, Microsoft.AspNet.Mvc.Xml.IWrapperProvider)

Initializes a [Microsoft.AspNet.Mvc.Xml.DelegatingEnumerable`2](Microsoft.AspNet.Mvc.Xml.DelegatingEnumerable`2.yml) with the original [System.Collections.Generic.IEnumerable`1]() and the wrapper provider for wrapping individual elements.

Arguments:
  • source (System.Collections.Generic.IEnumerable{{TDeclared}}) – The [System.Collections.Generic.IEnumerable`1]() instance to get the enumerator from.
  • elementWrapperProvider (Microsoft.AspNet.Mvc.Xml.IWrapperProvider) – The wrapper provider for wrapping individual elements.
public DelegatingEnumerable(IEnumerable<TDeclared> source, IWrapperProvider elementWrapperProvider)

Methods

Add(System.Object)

The serializer requires every type it encounters can be serialized and deserialized. This type will never be used for deserialization, but we are required to implement the add method so that the type can be serialized. This will never be called.

Arguments:
  • item (System.Object) – The item to add. Unused.
public void Add(object item)
Microsoft.AspNet.Mvc.Xml.DelegatingEnumerable<TWrapped, TDeclared>.GetEnumerator()

Gets a delegating enumerator of the original [System.Collections.Generic.IEnumerable`1]() source which is being wrapped.

Return type:System.Collections.Generic.IEnumerator{{TWrapped}}
Returns:The delegating enumerator of the original [System.Collections.Generic.IEnumerable`1]() source.
public IEnumerator<TWrapped> GetEnumerator()
Microsoft.AspNet.Mvc.Xml.DelegatingEnumerable<TWrapped, TDeclared>.System.Collections.IEnumerable.GetEnumerator()

Gets a delegating enumerator of the original [System.Collections.Generic.IEnumerable`1]() source which is being wrapped.

Return type:System.Collections.IEnumerator
Returns:The delegating enumerator of the original [System.Collections.Generic.IEnumerable`1]() source.
IEnumerator IEnumerable.GetEnumerator()