RingSoft.DataEntryControls.Engine.Annotations Namespace
RingSoft.DataEntryControls.WPF Namespace

NoEnumerationAttribute Class

Indicates that IEnumerable passed as a parameter is not enumerated. Use this annotation to suppress the 'Possible multiple enumeration of IEnumerable' inspection.

Namespace:  RingSoft.DataEntryControls.WPF
Assembly:  RingSoft.DataEntryControls.WPF (in RingSoft.DataEntryControls.WPF.dll)

Syntax


[AttributeUsageAttribute]
public sealed class NoEnumerationAttribute : Attribute
<AttributeUsageAttribute> _
Public NotInheritable Class NoEnumerationAttribute _
	Inherits Attribute
[AttributeUsageAttribute]
public ref class NoEnumerationAttribute sealed : public Attribute

Examples


C#
static void ThrowIfNull<T>([NoEnumeration] T v, string n) where T : class
{
// custom check for null but no enumeration
}
void Foo(IEnumerable<string> values)
{
ThrowIfNull(values, nameof(values));
var x = values.ToList(); // No warnings about multiple enumeration
}

Inheritance Hierarchy


Object
  Attribute
    RingSoft.DataEntryControls.WPF..::..NoEnumerationAttribute