1
This commit is contained in:
25
Packages/Core/Extensions/Object.cs
Normal file
25
Packages/Core/Extensions/Object.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
namespace BITKit
|
||||
{
|
||||
public static partial class Extensions
|
||||
{
|
||||
public static T IsNull<T>(this T t, Action action)
|
||||
{
|
||||
if (t is null)
|
||||
{
|
||||
action.Invoke();
|
||||
}
|
||||
return t;
|
||||
}
|
||||
public static T IsNotNull<T>(this T t, Action<T> action)
|
||||
{
|
||||
if (t is not null)
|
||||
{
|
||||
action.Invoke(t);
|
||||
}
|
||||
return t;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user