EgonsoftHU.Extensions.Bcl
3.0.0
Prefix Reserved
See the version list below for details.
Requires NuGet 4.1.0 or higher.
dotnet add package EgonsoftHU.Extensions.Bcl --version 3.0.0
NuGet\Install-Package EgonsoftHU.Extensions.Bcl -Version 3.0.0
<PackageReference Include="EgonsoftHU.Extensions.Bcl" Version="3.0.0" />
paket add EgonsoftHU.Extensions.Bcl --version 3.0.0
#r "nuget: EgonsoftHU.Extensions.Bcl, 3.0.0"
// Install EgonsoftHU.Extensions.Bcl as a Cake Addin #addin nuget:?package=EgonsoftHU.Extensions.Bcl&version=3.0.0 // Install EgonsoftHU.Extensions.Bcl as a Cake Tool #tool nuget:?package=EgonsoftHU.Extensions.Bcl&version=3.0.0
Egonsoft.HU BCL Extensions
C# extension methods for Base Class Library types.
Summary
- Extension methods for throwing
ArgumentNullException
- Extension methods for throwing
ArgumentException
- Extension methods for throwing
ArgumentOutOfRangeException
- Extension methods for specific types
- Extension methods with generic type parameters
- Predefined (
const
/readonly
) values - More information
Extension methods for throwing ArgumentNullException
or ArgumentException
- For generic
T
type:ThrowIfNull<T>()
throwsArgumentNullException
- For
System.String
type:ThrowIfNullOrEmpty()
throwsArgumentNullException
orArgumentException
ThrowIfNullOrWhiteSpace()
throwsArgumentNullException
orArgumentException
- For
System.Guid
type:ThrowIfEmptyGuid()
throwsArgumentException
Extension methods for throwing ArgumentOutOfRangeException
Would you like to use the new static methods in ArgumentOutOfRangeException
that were introduced in .NET 8 but your project targets an older framework?
In this package they are available as extension methods.
- For
IEquatable<T>
type:ThrowIfEqualTo()
ThrowIfNotEqualTo()
- For
IComparable<T>
type:ThrowIfLessThan()
ThrowIfLessThanOrEqualTo()
ThrowIfGreaterThan
ThrowIfGreaterThanOrEqualTo()
- For numeric types:
System.SByte
,System.Int16
,System.Int32
,System.Int64
,
System.Byte
,System.UInt16
,System.UInt32
,System.UInt64
,
System.Half
,System.Single
,System.Double
,System.Decimal
ThrowIfZero()
ThrowIfNegative()
ThrowIfNegativeOrZero()
ThrowIfPositive()
ThrowIfPositiveOrZero()
Extension methods for specific types
This package contains extension methods for these types:
System.Collections.Generic.ICollection<T>
AddRange()
System.Collections.Generic.IDictionary<TKey, TValue>
AsReadOnly()
AsSorted()
DefaultIfKeyNotFound()
GetOrThrow()
System.Collections.Generic.IEnumerable<T>
IsNullOrEmpty()
DetectChanges()
- Get new, existing and removed items.
System.Collections.Generic.IList<T>
AsReadOnly()
up to .NET 6 (An extension method with the same signature is part of .NET 7+.)
System.DateOnly
IsInRange()
System.DateTime
IsInRange()
ToMinutePrecision()
ToSecondPrecision()
System.DateTimeOffset
IsInRange()
ToMinutePrecision()
ToSecondPrecision()
System.Exception
GetHttpStatusCode()
SetHttpStatusCode()
System.IO.Stream
ToByteArray()
ToByteArrayAsync()
TryResetStreamPosition()
System.Reflection.Assembly
System.Reflection.MemberInfo
System.Reflection.ParameterInfo
System.String
IsNullOrEmpty()
IsNullOrWhiteSpace()
DefaultIfNullOrEmpty()
DefaultIfNullOrWhiteSpace()
EnsureTrailingSlash()
EnsureNoTrailingSlash()
System.Type
AsNullableValueType()
IsNullableValueType()
- Numeric types:
System.SByte
,System.Int16
,System.Int32
,System.Int64
,
System.Byte
,System.UInt16
,System.UInt32
,System.UInt64
,
System.Half
,System.Single
,System.Double
,System.Decimal
IsZero()
IsNegative()
IsNegativeOrZero()
IsPositive()
IsPositiveOrZero()
IsInRange()
Extension methods with generic type parameters
IEnumerable
-relatedAsSingleElementSequence()
IsIn()
IsNotIn()
Reflection
-relatedGetPropertyValue()
TryPropertyValue()
SetPropertyValue()
TrySetPropertyValue()
- value selectors
GetStringValueOrNull()
GetStringValueOrEmptyString()
GetValueOrDefault()
GetValue()
Predefined (const
/ readonly
) values
Chars
DateTimeFormats
GenericTypeDefinitions
GuidFormats
HttpStatusCodes
Strings
enum
types
IntervalBoundsOptions
- can be used in the newIsInRange()
extension methods.
Other types
EnumInfo<TEnum>
- A wrapper class that provides additional information about an
enum
type or value.- The custom attributes applied to a member.
- Easy access to the list of the defined members.
- Easy access to the name or the underlying value of a member.
- Support for customizing the serialized value through attributes.
- Implements bitwise / comparison / implicit conversion / equality operators.
- A wrapper class that provides additional information about an
EncodingProvider
UTF8WithoutBOM
The UTF-8 encoding without the Unicode byte order mark.
StringSyntaxAttribute
- up to .NET 6 (This attribute is part of .NET 7+.)
StructuralEqualityComparer<T>
- Provides a generic
IEqualityComparer<T>
instance for using the non-genericSystem.Collections.StructuralComparisons.StructuralEqualityComparer
.
- Provides a generic
TypeHelper
GetName<T>()
/GetName(Type)
methods as a shortcut forType.FullName ?? Type.Name
expression.
More information
Learn more at https://github.com/gcsizmadia/EgonsoftHU.Extensions.Bcl
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 is compatible. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 3.1
- No dependencies.
-
.NETFramework 4.6.2
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
-
.NETStandard 2.0
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
-
.NETStandard 2.1
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
-
net6.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on EgonsoftHU.Extensions.Bcl:
Package | Downloads |
---|---|
EgonsoftHU.Extensions.DependencyInjection.Abstractions
Abstractions for dependency injection. Commonly Used Types: EgonsoftHU.Extensions.DependencyInjection.IAssemblyRegistry EgonsoftHU.Extensions.DependencyInjection.DefaultAssemblyRegistry |
|
EgonsoftHU.Extensions.Logging.Serilog
Serilog.ILogger extensions: - Enrich log events with the name of the source member (method, property, etc.) in which the log event occurs. - Enrich log events with multiple properties at once using PropertyBagEnricher. - Populate Exception.Data dictionary with the log event properties. |
|
EgonsoftHU.Text.Json
System.Text.Json extensions. Supports any attribute for enum member serialization. Provides option for using your own custom serializer implementation for enum members. Built-in attribute support: System.Text.Json.Serialization.JsonStringEnumMemberNameAttribute (>= 9.0.0) System.Runtime.Serialization.EnumMemberAttribute System.ComponentModel.DescriptionAttribute System.ComponentModel.DisplayNameAttribute System.ComponentModel.DataAnnotations.DisplayAttribute Commonly Used Types: EgonsoftHU.Text.Json.Serialization.JsonStringEnumConverter EgonsoftHU.Text.Json.Serialization.Converters.JsonEnumValueSerializer EgonsoftHU.Text.Json.JsonSerializerOptionsProvider |
GitHub repositories
This package is not used by any popular GitHub repositories.
Please visit https://github.com/gcsizmadia/EgonsoftHU.Extensions.Bcl/releases to view the release notes.