mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 04:58:24 +01:00
SOURCE DUMP v1
This commit is contained in:
parent
bd62d51ec9
commit
fb20299e9d
1 changed files with 768360 additions and 0 deletions
27
brutal.core/Brutal.Core/Interfaces/INullable.cs
Normal file
27
brutal.core/Brutal.Core/Interfaces/INullable.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
namespace Brutal;
|
||||
|
||||
/// <summary>
|
||||
/// Interface for a type that can be null
|
||||
/// </summary>
|
||||
public interface INullable
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns true if the instance is null
|
||||
/// </summary>
|
||||
public bool IsNull();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extensions for INullable
|
||||
/// </summary>
|
||||
public static class NullableExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns true if the instance is not null
|
||||
/// </summary>
|
||||
public static bool IsNotNull<T>(this T nullable)
|
||||
where T : INullable
|
||||
{
|
||||
return !nullable.IsNull();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue