EasyLevel.EasyCSharp 1.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package EasyLevel.EasyCSharp --version 1.2.0
                    
NuGet\Install-Package EasyLevel.EasyCSharp -Version 1.2.0
                    
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="EasyLevel.EasyCSharp" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EasyLevel.EasyCSharp" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="EasyLevel.EasyCSharp" />
                    
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 EasyLevel.EasyCSharp --version 1.2.0
                    
#r "nuget: EasyLevel.EasyCSharp, 1.2.0"
                    
#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 EasyLevel.EasyCSharp@1.2.0
                    
#: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=EasyLevel.EasyCSharp&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=EasyLevel.EasyCSharp&version=1.2.0
                    
Install as a Cake Tool

Easy C#

The main concept of this library is to add extensions to existing types, which allows you to access the object directly more often, rather than using static classes, as is customary in C#.

Let's look at a simple example: checking for an empty string. It would be more intuitive and simple to find out if a string is empty using the IsEmpty property or method, but in C# there is no such possibility, and you need to call the static string.IsNullOrEmpty method. The library will add an extension method for this case and it will be possible to call the IsEmpty method on the string object. Similar situations arise when working with other types of data.

The purpose of the library is to provide the ability to use the most common functions in the form of extensions.

Extensions

There are many extensions for types that simplify the code:

  • Lang extensions:

    • IsEmpty, NotEmpty for check an object is null object or an empty string or an empty collection;

    • Clone to fully clone an object;

    • OnChange for track changes to a property of an object;

    • With to configure an object along a chain.

  • Collection extensions (Contains, Shuffle, RandomElement, InsertFirst, ClearDuplicates, RemoveAll, RemoveFirst, RemoveLast);

  • Convert extensions (bytesArray.Size(), ComputeHash, list.ToStringEnumerable(), Number to TimeSpan (50.Milliseconds(), 2.Seconds(), 5.Minutes()...);

  • Strings extensions (Remove, ParseTo, ReplaceFirst, ReplaceLast, AddLinkQuery);

  • Math extensions for numbers (Abs, Clamp, Pow, Sin, Exp...);

  • Task extensions (WaitInBackground, Timeout).

Keywords

The keywords are needed to refer to certain functions that are not logical to do as extensions, but they are very easy to remember. In fact, these are static classes:

  • The random keyword is needed to create random numbers or objects (random.Int(1, 100), Bool, Guid, Float, Double, IntMinMax, BigInteger, String);

  • The code keyword is needed to refer to the written code for metaprogramming, for example, which types (code.Types) are in the current program and find a specific one among them;

  • The strings keyword for referring to popular string constants (Empty, NewLine, Tab, Space, Null).

Standards

In different projects, there is a repeatability of certain functionality, for which it is advisable to develop a unified interface. This will ensure uniformity in the use of functions regardless of the specifics of a particular project. The implementation of this interface can be adapted depending on the requirements of a particular project.

  • Static class Logging.Log is designed to register log messages during the execution of the program;

  • Static class FileSystem.LocalStorage that implements an interface for managing local data;

  • Class Http.HttpRequest for working with http requests (GET, POST, PUT, DELETE);

  • Class WebSockets.WebSocket for working with websocket protocol;

  • Static class Network.Internet for accessing popular functions when working with the network (GetMyIPAddress, GetDomain, DateTimeNow);

  • Static class Network.LocalNetwork for getting information about the local network (current IPv4, IPv6, Controller (NIC), FreePort, IsPortFree);

  • Static class System.Threading.Tasks.TaskManager for managing tasks in an application.

Additional features

  • FileSystem.File and FileSystem.Folder for easy work with files and folders;

  • CodeGeneration.ScriptBuilder and CodeGeneration.EnumBuilder for easy generate script.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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.3.5 117 10/28/2024
1.3.4 121 10/20/2024
1.3.3 132 10/20/2024
1.3.2 123 10/20/2024
1.3.1 146 10/19/2024
1.3.0 140 10/19/2024
1.2.2 140 10/18/2024
1.2.1 115 10/12/2024
1.2.0 110 10/12/2024
1.1.3 104 10/12/2024
1.1.2 105 10/12/2024
1.1.1 114 10/8/2024
1.1.0 109 10/8/2024
1.0.0 119 10/6/2024
0.4.0 138 9/18/2024
0.3.9 116 9/18/2024
0.3.8 142 9/15/2024
0.3.7 122 9/15/2024
0.3.6 133 9/14/2024
0.3.5 128 9/13/2024
0.3.4 128 9/8/2024
0.3.3 116 9/8/2024
0.3.2 135 9/6/2024
0.3.1 118 9/6/2024
0.3.0 132 9/6/2024
0.2.9 121 9/6/2024
0.2.8 122 9/1/2024
0.2.7 127 9/1/2024
0.2.6 131 8/27/2024
0.2.5 141 8/23/2024
0.2.4 144 8/23/2024
0.2.3 145 8/22/2024
0.2.2 139 8/21/2024
0.2.1 133 8/21/2024
0.1.9 138 8/21/2024
0.1.8 134 8/15/2024
0.1.7 133 8/14/2024
0.1.6 150 8/13/2024
0.1.5 143 8/11/2024
0.1.4 90 8/6/2024
0.1.3 106 8/1/2024
0.1.2 115 7/27/2024
0.1.1 110 7/27/2024
0.1.0 116 7/27/2024