From 3aab47e9c6f280aa51553bc5385798ae22e9125c Mon Sep 17 00:00:00 2001 From: Kyle Ratti Date: Fri, 23 Dec 2022 12:38:51 -0500 Subject: [PATCH] chore: dual-target Base to .NET Standard 2.0 --- Base/Base.csproj | 6 +++--- Base/Extensions/DataReaderExtensions.cs | 3 ++- Base/Extensions/EnumerableExtensions.cs | 6 +++++- Base/Extensions/StringExtensions.cs | 6 ++++-- Base/Structures/Maybe.cs | 3 +++ Base/Structures/MaybeExtensions.cs | 5 ++++- Base/Structures/OneOf.cs | 4 +++- 7 files changed, 24 insertions(+), 9 deletions(-) diff --git a/Base/Base.csproj b/Base/Base.csproj index 83a9041..62d9909 100755 --- a/Base/Base.csproj +++ b/Base/Base.csproj @@ -1,8 +1,9 @@ - net6.0 - enable + net6.0;netstandard2.0 + 10 + disable enable FruityFoundation.Base true @@ -15,7 +16,6 @@ true LICENSE - diff --git a/Base/Extensions/DataReaderExtensions.cs b/Base/Extensions/DataReaderExtensions.cs index 067bc81..2f31ccc 100644 --- a/Base/Extensions/DataReaderExtensions.cs +++ b/Base/Extensions/DataReaderExtensions.cs @@ -1,4 +1,5 @@ -using System.Data; +using System; +using System.Data; using FruityFoundation.Base.Structures; namespace FruityFoundation.Base.Extensions; diff --git a/Base/Extensions/EnumerableExtensions.cs b/Base/Extensions/EnumerableExtensions.cs index 0f27ae7..b1da234 100644 --- a/Base/Extensions/EnumerableExtensions.cs +++ b/Base/Extensions/EnumerableExtensions.cs @@ -1,4 +1,8 @@ -namespace FruityFoundation.Base.Extensions; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace FruityFoundation.Base.Extensions; public static class EnumerableExtensions { diff --git a/Base/Extensions/StringExtensions.cs b/Base/Extensions/StringExtensions.cs index c8f34c8..ab1a013 100644 --- a/Base/Extensions/StringExtensions.cs +++ b/Base/Extensions/StringExtensions.cs @@ -1,4 +1,6 @@ -namespace FruityFoundation.Base.Extensions; +using System; + +namespace FruityFoundation.Base.Extensions; public static class StringExtensions { @@ -14,5 +16,5 @@ public static class StringExtensions /// /// The maximum number of characters. If has fewer characters, it will be truncated to the length of . public static string Truncate(this string str, int maxLength) => - str[..Math.Min(str.Length, maxLength)]; + str.Substring(0, Math.Min(str.Length, maxLength)); } \ No newline at end of file diff --git a/Base/Structures/Maybe.cs b/Base/Structures/Maybe.cs index b75bce9..98d700f 100644 --- a/Base/Structures/Maybe.cs +++ b/Base/Structures/Maybe.cs @@ -1,5 +1,8 @@ // Normally we wouldn't want to disable Nullable references, but in this case we want to. // We're assuming that if you're following Maybe conventions, you won't be hitting null ref exceptions. + +using System; + #pragma warning disable CS8601 namespace FruityFoundation.Base.Structures; diff --git a/Base/Structures/MaybeExtensions.cs b/Base/Structures/MaybeExtensions.cs index 733c574..0974bd4 100644 --- a/Base/Structures/MaybeExtensions.cs +++ b/Base/Structures/MaybeExtensions.cs @@ -1,4 +1,7 @@ -namespace FruityFoundation.Base.Structures; +using System; +using System.Collections.Generic; + +namespace FruityFoundation.Base.Structures; public static class MaybeExtensions { diff --git a/Base/Structures/OneOf.cs b/Base/Structures/OneOf.cs index a485ea1..5a082c4 100644 --- a/Base/Structures/OneOf.cs +++ b/Base/Structures/OneOf.cs @@ -1,4 +1,6 @@ -namespace FruityFoundation.Base.Structures; +using System; + +namespace FruityFoundation.Base.Structures; public class OneOf {