CollectionAccessAttribute Class
Indicates how method, constructor invocation, or property access
over collection type affects the contents of the collection.
Use CollectionAccessType to specify the access type.
Namespace:
RingSoft.DbMaintenanceAssembly: RingSoft.DbMaintenance (in RingSoft.DbMaintenance.dll)
Syntax
[AttributeUsageAttribute] public sealed class CollectionAccessAttribute : Attribute
<AttributeUsageAttribute> _ Public NotInheritable Class CollectionAccessAttribute _ Inherits Attribute
[AttributeUsageAttribute] public ref class CollectionAccessAttribute sealed : public Attribute
Remarks
Examples
C#
public class MyStringCollection : List<string> { [CollectionAccess(CollectionAccessType.Read)] public string GetFirstString() { return this.ElementAt(0); } } class Test { public void Foo() { // Warning: Contents of the collection is never updated var col = new MyStringCollection(); string x = col.GetFirstString(); } }