// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Diagnostics.CodeAnalysis;
///
/// Specifies that the method or property will ensure that the listed field and property members have not-null values.
///
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
internal sealed class MemberNotNullAttribute : Attribute
{
///
/// Initializes the attribute with a field or property member.
///
/// The field or property member that is promised to be not-null.
public MemberNotNullAttribute(string member)
{
Members = new[] { member };
}
///
/// Initializes the attribute with the list of field and property members.
///
/// The list of field and property members that are promised to be not-null.
public MemberNotNullAttribute(params string[] members)
{
Members = members;
}
///
/// Gets field or property member names.
///
public string[] Members { get; }
}