加入可空特性相关stub,让下游net40应用具备可空特性判断能力。主要是Stardust和NewLife.IoT
大石头 authored at 2023-10-21 08:41:04
511.00 B
X
#if NETFRAMEWORK || NETSTANDARD2_0
namespace System.Diagnostics.CodeAnalysis;

/// <summary>当返回指定值时可能为空</summary>
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
public sealed class MaybeNullWhenAttribute : Attribute
{
    /// <summary>返回值</summary>
    public Boolean ReturnValue { get; }

    /// <summary>实例化</summary>
    /// <param name="returnValue"></param>
    public MaybeNullWhenAttribute(Boolean returnValue) => ReturnValue = returnValue;
}
#endif