File tree Expand file tree Collapse file tree
GameFrameX.Foundation.Extensions Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44//
55// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
66
7+ using System . Diagnostics . CodeAnalysis ;
78using GameFrameX . Foundation . Localization . Core ;
89using GameFrameX . Foundation . Extensions . Localization ;
910
@@ -24,7 +25,7 @@ public static class ObjectExtensions
2425 /// 此方法仅适用于引用类型,对值类型调用此方法会导致编译错误。
2526 /// 这是为了避免对值类型(永远不会为null)调用此方法产生误导性结果。
2627 /// </remarks>
27- public static bool IsNull < T > ( this T self ) where T : class
28+ public static bool IsNull < T > ( [ NotNullWhen ( false ) ] this T self ) where T : class
2829 {
2930 return self is null ;
3031 }
@@ -39,7 +40,7 @@ public static bool IsNull<T>(this T self) where T : class
3940 /// 此方法仅适用于引用类型,对值类型调用此方法会导致编译错误。
4041 /// 这是为了避免对值类型(永远不会为null)调用此方法产生误导性结果。
4142 /// </remarks>
42- public static bool IsNotNull < T > ( this T self ) where T : class
43+ public static bool IsNotNull < T > ( [ NotNullWhen ( true ) ] this T self ) where T : class
4344 {
4445 return self is not null ;
4546 }
You can’t perform that action at this time.
0 commit comments