X.Helper.Extension 1.0.15

dotnet add package X.Helper.Extension --version 1.0.15
                    
NuGet\Install-Package X.Helper.Extension -Version 1.0.15
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="X.Helper.Extension" Version="1.0.15" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="X.Helper.Extension" Version="1.0.15" />
                    
Directory.Packages.props
<PackageReference Include="X.Helper.Extension" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add X.Helper.Extension --version 1.0.15
                    
#r "nuget: X.Helper.Extension, 1.0.15"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package X.Helper.Extension@1.0.15
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=X.Helper.Extension&version=1.0.15
                    
Install as a Cake Addin
#tool nuget:?package=X.Helper.Extension&version=1.0.15
                    
Install as a Cake Tool

X.Helper.Extension

DataTable

Method Description
ToEntity Converts the DataTable to a list of entities of type T.

DateTime

Method Description
ToUtc Converts the current DateTime to UTC.
ToLocal Converts the current DateTime to Local time.
ToUnixTimeStampSeconds Converts the current DateTime to Unix Time Stamp in seconds.
ToUnixTimeStampMilliseconds Converts the current DateTime to Unix Time Stamp in milliseconds.
ToUnixTimeStampTicks Converts the current DateTime to Unix Time Stamp in ticks.
FromUnixTimeStampSeconds Converts a Unix Time Stamp in seconds to DateTime.
FromUnixTimeStampMilliseconds Converts a Unix Time Stamp in milliseconds to DateTime.
IsDaylightSavingActive Checks if the current DateTime is in Daylight Saving Time.
FormatToNow Formats the current DateTime to a string relative to now.
FormatFromNow Formats the current DateTime to a string relative to a specified DateTime.

Debug

Method Description
DEBUG Call Console.WriteLine output debug information.

DirectoryInfo

Method Description
Remove Deletes the Directory and all its contents, including subdirectories and files.

enum

Method Description
GetDisplayName Gets the Display(Name="***") of the enum value.
GetDisplayDescription Gets the Display(Description="***") of the enum value.
GetDescription Gets the Description("***") of the enum value.
GetEnumTypeFromString Converts a string to the corresponding enum type.

FileInfo

Method Description
ToStream Converts the File to a Stream.
ToBase64 Converts the File to a Base64 string.
GetSHA1 Computes the SHA1 hash of the File.
GetSHA256 Computes the SHA256 hash of the File.
GetSHA512 Computes the SHA512 hash of the File.
GetMD5 Computes the MD5 hash of the File.
ImageFromFile Read file and convert it to Image class.

IList<T>

Method Description
IsNullOrEmpty Checks if the IList is null or empty.
HasObject Checks if the IList contains any objects.

IDictionary<K,V>

Method Description
IsNullOrEmpty Checks if the IDictionary is null or empty.
IsNotNullOrEmpty Checks if the IDictionary is not null or empty.
HasObject Checks if the IDictionary contains any objects.

Image

Method Description
GetThumbnail Gets a thumbnail of the Image with specified width and height and specified area.
WatermarkText Adds a text watermark to the Image with specified font size, color, and position.
WatermarkImage Adds an image watermark to the Image with specified position and opacity.

long

Method Description
ToHex62 Converts the long to a base62 string.
ToHex10FromHex62 Converts a base62 string to a long.

object

Method Description
IsNull Checks if the object is null.
IsNotNull Checks if the object is not null.
ToByteArray Converts the object to a byte array.
GetDisplayName Gets the Display(Name="***") of the object if it is an enum value.
GetDisplayDescription Gets the Display(Description="***") of the object if it is an enum value.
GetDescription Gets the Description("***") of the object if it is an enum value.

string

Method Description
IsNullOrEmpty Checks if the string is null or empty.
IsNotNullOrEmpty Checks if the string is not null or empty.
IsNullOrWhiteSpace Checks if the string is null or consists only of white-space characters.
IsNotNullOrWhiteSpace Checks if the string is not null and contains non-white-space characters.
ReplaceCRLF Replace all occurrences of CRLF (carriage return + line feed) or individual CR or LF in the string with a specified string (default is an empty string).
ReplaceCR Replace all occurrences of CR (carriage return) in the string with a specified string (default is an empty string).
ReplaceLF Replace all occurrences of LF (line feed) in the string with a specified string (default is an empty string).
ToMD5 Computes the MD5 hash of the string and returns it as a MD5 string.
ToMD5(salt="salt string") Computes the MD5 hash of the string with an optional salt and returns it as a MD5 string.
ToBase64 Converts the string to a Base64 string.
IsFileExists Checks if the string is a valid file path and if the file exists at that path.
IsDirectoryExists Checks if the string is a valid directory path and if the directory exists at that path.
GetFileName Gets the file name from the string, which is expected to be a file path.
GetFileNameWithoutExtension Gets the file name without the extension from the string, which is expected to be a file path.
GetFileExtensionName Gets the file extension name from the string, which is expected to be a file path.
Base64ToFile Converts a Base64 string to a file at the specified path.
RegularExpression
IsLetterOrNumber Checks if the string contains only letters and numbers.
IsCNMobileNumber Checks if the string is a valid Chinese mobile phone number.
IsCNTelephoneNumber Checks if the string is a valid Chinese telephone number.
IsEmail Checks if the string is a valid email address.
IsCNZipCode Checks if the string is a valid Chinese postal code.
IsNumber Checks if the string contains only numbers. not starting with zero
IsNumberStr Checks if the string contains only numbers, including leading zeros.
IsNumeric Checks if the string is a valid numeric value, including integers and decimals.
GetThumbnail Retrieve thumbnail images of the specified width, height, and area from the image file, and save them to the specified location, if the string is the image file path.

stream

Method Description
ToByteArray Converts the Stream to a byte array.
ToFile Converts the Stream to a File at the specified path.
ToMemoryStream Converts the Stream to a MemoryStream.

T

Method Description
CreateEmptyList<T> Creates an empty list of type T.
Product 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 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 is compatible.  net462 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.15 231 8/4/2025
1.0.14 430 7/25/2025
1.0.13 564 7/22/2025
1.0.12 198 7/17/2025
1.0.11 194 7/1/2025
1.0.10.2 215 5/19/2025
1.0.10.1 193 9/20/2024
1.0.10 190 5/22/2024