Introduce the foundation for the new username system

This commit is contained in:
Tyrrrz
2023-06-08 16:37:05 +03:00
parent bf0d8ab31e
commit 3d2d197904
11 changed files with 56 additions and 32 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
namespace DiscordChatExporter.Core.Utils.Extensions;
@@ -10,4 +11,7 @@ public static class GenericExtensions
!predicate(value)
? value
: null;
public static T? NullIfDefault<T>(this T value) where T : struct =>
value.NullIf(v => EqualityComparer<T>.Default.Equals(v, default));
}