RingSoft.DbLookup.Controls.WPF.Properties Namespace
RingSoft.DbMaintenance 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.DbMaintenance
Assembly:  RingSoft.DbMaintenance (in RingSoft.DbMaintenance.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.DbMaintenance..::..NoEnumerationAttribute