Class MemberNotNullWhenAttribute
Specifies that the method or property will ensure that the listed field and property members have not-null values when returning with the specified return value condition.
Inherited Members
Namespace: System.Diagnostics.CodeAnalysis
Assembly: Couchbase.NetClient.dll
Syntax
[AttributeUsage(AttributeTargets.Method|AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
public sealed class MemberNotNullWhenAttribute : Attribute
Constructors
| Edit this page View SourceMemberNotNullWhenAttribute(bool, string)
Initializes the attribute with the specified return value condition and a field or property member.
Declaration
public MemberNotNullWhenAttribute(bool returnValue, string member)
Parameters
Type | Name | Description |
---|---|---|
bool | returnValue | The return value condition. If the method returns this value, the associated parameter will not be null. |
string | member | The field or property member that is promised to be not-null. |
MemberNotNullWhenAttribute(bool, params string[])
Initializes the attribute with the specified return value condition and list of field and property members.
Declaration
public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
Parameters
Type | Name | Description |
---|---|---|
bool | returnValue | The return value condition. If the method returns this value, the associated parameter will not be null. |
string[] | members | The list of field and property members that are promised to be not-null. |
Properties
| Edit this page View SourceMembers
Gets field or property member names.
Declaration
public string[] Members { get; }
Property Value
Type | Description |
---|---|
string[] |
ReturnValue
Gets the return value condition.
Declaration
public bool ReturnValue { get; }
Property Value
Type | Description |
---|---|
bool |