MhLabs.Extensions
2.0.0
dotnet add package MhLabs.Extensions --version 2.0.0
NuGet\Install-Package MhLabs.Extensions -Version 2.0.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="MhLabs.Extensions" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MhLabs.Extensions --version 2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MhLabs.Extensions, 2.0.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.
// Install MhLabs.Extensions as a Cake Addin #addin nuget:?package=MhLabs.Extensions&version=2.0.0 // Install MhLabs.Extensions as a Cake Tool #tool nuget:?package=MhLabs.Extensions&version=2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MhLabs.Extensions
Collection of extension / helper methods System types.
StringExtensions.cs
string.ToUri()
creates a Uri from string.
Throws UriFormatException
Example:
var uri = "https://api.mathem.io/api".ToUri();
string.To<T>()
creates an object T from json string.
Throws JsonReaderException
Example:
var order = jsonString.To<Order>();
string.Truncate(maxLength)
truncates a string to its max length
Throws ArgumentOutOfRangeException
Example:
var newString = oldString.Truncate(10);
## OrderExtensions.cs
```object.ToJson()```
creates an object T from json string.
Example:
var order = new Order { ... } var json = order.ToJson();
## Env.cs
```Env.Get(key)```
Short hand for Environment.GetEnvironmentVariable(key);
Example:
var apiUrl = Env.Get(ApiBaseUrl);
## CollectionExtension.cs
```IEnumerable.IsNullOrEmpty()```
returns true if collection is null or empty
```IEnumerable.GetChunks(chunkSize)```
returns a IEnumerable of IEnumerable chunks
## Pushing a new version
Set the `Version` number in the <a href="https://github.com/mhlabs/MhLabs.Extensions/blob/master/MhLabs.Extensions/MhLabs.Extensions.csproj"> .csproj-file</a> before pushing. If an existing version is pushed the <a href="https://github.com/mhlabs/MhLabs.Extensions/actions">build will fail</a>.
## Publish pre-release packages on branches to allow us to test the package without merging to master
1. Create a new branch
2. Update `Version` number and add `-beta` postfix (can have .1, .2 etc. at the end)
3. Make any required changes updating the version as you go
4. Test beta package in solution that uses package
5. Create PR and get it reviewed
6. Check if there are any changes on the branch you're merging into. If there are you need to rebase those changes into yours and check that it still builds
7. As the final thing before merging update version number and remove post fix
Product | Versions 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. |
.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.
-
.NETStandard 2.1
- Newtonsoft.Json (>= 13.0.2)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on MhLabs.Extensions:
Package | Downloads |
---|---|
MhLabs.AwsSignedHttpClient
Package Description |
|
MhLabs.APIGatewayLambdaProxy
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.0.0 | 5,231 | 1/13/2023 |
1.0.11 | 8,416 | 12/17/2021 |
1.0.10 | 19,809 | 10/18/2021 |
1.0.9 | 446 | 10/17/2021 |
1.0.8 | 6,670 | 1/27/2021 |
1.0.7 | 4,276 | 1/22/2021 |
1.0.6 | 6,768 | 10/19/2020 |
1.0.5 | 18,086 | 2/7/2020 |
1.0.4 | 11,730 | 9/10/2019 |
1.0.3 | 14,606 | 3/22/2019 |
1.0.2 | 641 | 3/19/2019 |
1.0.1 | 9,454 | 3/14/2019 |
1.0.0 | 4,939 | 2/17/2019 |