diff --git a/IntelliTect.Multitool.sln b/IntelliTect.Multitool.sln index c8e225a..b0fa57a 100644 --- a/IntelliTect.Multitool.sln +++ b/IntelliTect.Multitool.sln @@ -13,6 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .github\workflows\deploy.yml = .github\workflows\deploy.yml Directory.Build.props = Directory.Build.props Directory.Packages.props = Directory.Packages.props + global.json = global.json README.md = README.md EndProjectSection EndProject diff --git a/IntelliTect.Multitool/Extensions/SystemLinqExtensions.cs b/IntelliTect.Multitool/Extensions/SystemLinqExtensions.cs new file mode 100644 index 0000000..cfb879e --- /dev/null +++ b/IntelliTect.Multitool/Extensions/SystemLinqExtensions.cs @@ -0,0 +1,18 @@ +namespace IntelliTect.Multitool.Extensions; + +/// +/// Various Linq extensions +/// +public static class SystemLinqExtensions +{ + /// + /// Filters a sequence of values to only those that are not null. + /// + /// The type of the elements of source. + /// A to filter. + /// An that contains elements from the input that are not null. + public static IEnumerable WhereNotNull(this IEnumerable source) where T : class? + { + return (IEnumerable)source.Where(item => item is not null); + } +}