maestrianet - Maestria.Extensions 3.3.1
Extension function pack to increase productivity and improve source code writing.
PM> Install-Package Maestria.Extensions -Version 3.3.1 -Source https://www.myget.org/F/maestrianet/api/v3/index.json
> nuget.exe install Maestria.Extensions -Version 3.3.1 -Source https://www.myget.org/F/maestrianet/api/v3/index.json
> dotnet add package Maestria.Extensions --version 3.3.1 --source https://www.myget.org/F/maestrianet/api/v3/index.json
source https://www.myget.org/F/maestrianet/api/v3/index.json
nuget Maestria.Extensions ~> 3.3.1
Copy to clipboard
> choco install Maestria.Extensions --version 3.3.1 --source https://www.myget.org/F/maestrianet/api/v2
Import-Module PowerShellGet
Register-PSRepository -Name "maestrianet" -SourceLocation "https://www.myget.org/F/maestrianet/api/v2"
Install-Module -Name "Maestria.Extensions" -RequiredVersion "3.3.1" -Repository "maestrianet"
Copy to clipboard
Maestria.Extensions
- What is Maestria.Extensions?
- What is Maestria Project?
- Where can I get it?
- How do I get started?
- Data Types
- Settings
- Full usage documentations
- Extra documentations
If my contributions helped you, please help me buy a coffee :D
What is Maestria.Extensions?
Extension function pack to increase productivity and improve source code writing. By default, all extension methods are safe.
What is Maestria Project?
This library is part of Maestria Project.
Maestria is a project to provide productivity and elegance to your source code writing.
Where can I get it?
Install the Maestria.Extensions using the command line:
dotnet add package Maestria.Extensions
How do I get started?
First, import "Maestria.Extensions" reference:
using Maestria.Extensions;
Then in your application code, use fluent syntax:
// 1. Numeric rounding
using Maestria.Extensions;
decimal value = 3.14159m;
var rounded = value.Round(2); // 3.14
// Detailed: [Number extensions](docs/usage/number.md)
// 2. Range check
int score = 85;
bool isGradeB = score.Between(80, 89); // true
// Detailed: [Comparable extensions](docs/usage/comparable.md)
// 3. Enum display name
DayOfWeek day = DayOfWeek.Monday;
string name = day.GetDisplayName(); // "Monday"
// Detailed: [Enum extensions](docs/usage/enum.md)
// 4. Collection has items
var list = new[] { 1, 2, 3 };
bool has = list.HasItems(); // true
// Detailed: [Enumerable extensions](docs/usage/enumerable.md)
// 5. String trimming
string path = "/folder/";
var trimmed = path.TrimEnd("/"); // "/folder"
// Detailed: [String extensions](docs/usage/string.md)
// 6. XML escaping
string xml = "<tag>\"Value\" & More</tag>";
var escaped = xml.EscapeXml(); // "<tag>"Value" & More</tag>"
// Detailed: [String extensions](docs/usage/string.md)
// 7. Base64 encoding
string text = "hello";
var b64 = text.ToBase64(); // "aGVsbG8="
// Detailed: [String extensions](docs/usage/string.md)
// 8. Guid handling
Guid guid = Guid.Empty;
var newGuid = guid.IfEmpty().Then(Guid.NewGuid());
// Detailed: [Other extensions](docs/usage/other.md)
// 9. Pipeline example
var result = "12345"
.OnlyNumbers()
.Format("{0:###-##}"); // "123-45"
// Detailed: [String extensions](docs/usage/string.md)
Data Types
The library ships with two expressive result types that eliminate boilerplate error handling:
Result and Result<TValue>
// Result — implicit conversions keep method signatures clean
public Result Save(Order order)
{
if (order == null) return "Order cannot be null"; // implicit failure
// ...
return true; // implicit success
}
var result = Save(order);
if (result) Console.WriteLine("Saved!");
else Console.WriteLine(result.Message);
Try<TSuccess, TFailure>
// Try<TSuccess, TFailure> — distinct types for success and failure
public Try<OrderCreated, ValidationError> Submit(Order order) { ... }
var r = Submit(order);
if (r) Console.WriteLine($"Order ID: {r.Value.Id}");
else Console.WriteLine($"Error {r.Failure.Code}: {r.Failure.Message}");
See docs/usage/datatypes.md for full documentation, implicit conversion rules,
Result<T>, and advanced usage.
Settings
It's possible set default settings for library:
MaestriaExtensionsSettings.Configure(config => config
.FloatingPointTolerance(<default-float-and-double-comparasion-tolerance>) // Default is 0.00001f
.DefaultEncoding(<encoding>) // Default if Encoding.UTF8
Full usage documentations
There are many more extension methods available. See the full documentation:
| Topic | Samples methods |
|---|---|
| Comparable & fluent expressions | Between, In, LimitToMin, LimitToMax, fluent If...Then, NullIf |
| Data types | Result, Try<TSuccess, TFailure> |
| Enum extensions | GetDisplayName, GetDescription, GetValues |
| Enumerable & collection extensions | HasItems, IsNullOrEmpty, Iterate, TryGetValue, WithIndex |
| Number extensions | Round, RoundUp, Truncate for numeric types |
| Other extensions | OutVar and pipeline helpers |
| String extensions | Trimming, substring, hashing, Base64, encoding, and more |
Extra documentations
See additional documentations at docs folder.
- changelog.md: List of changes by version and breaking changes.
- ci-workflow.md: Description of the CI workflow used in the project.
- contributing.md: How to contribute to the project.
If my contributions helped you, please help me buy a coffee :D
- .NETStandard 2.0: 2.0.0.0
OwnersFábio Naspolini |
AuthorsFábio Monteiro Naspolini |
Project URLhttps://github.com/MaestriaNet/Extensions |
LicenseUnknown |
TagsExtensionMethod ExtensionMethods HelperMethods Helper Extension Extensions Fluent Functional Elegance Productivity Maestria Mastery IEnumerable Enumerable ICollection Collection IList List Array Max Min Highest Smallest Largest String Text IfNull NullIf Null If In Between Truncate Round Hash MD5 SHA1 Enum Aggreagate Exception StackTrace C# .NET CSharp Method Methods |
Info7668 total downloads |
| 108 downloads for version 3.3.1 |
| Download (29.64 KB) |
| Found on the current feed only |
Package history
| Version | Size | Last updated | Downloads | Mirrored? | |||
|---|---|---|---|---|---|---|---|
|
|
4.0.2 | 141.06 KB | Tue, 21 Jul 2026 00:56:32 GMT | 0 |
|
||
|
|
4.0.2-preview.pr-78 | 141.08 KB | Tue, 21 Jul 2026 00:54:18 GMT | 0 |
|
||
|
|
4.0.2-preview.pr-77 | 141.11 KB | Tue, 21 Jul 2026 00:07:53 GMT | 0 |
|
||
|
|
4.0.1 | 141.11 KB | Mon, 20 Jul 2026 21:25:22 GMT | 0 |
|
||
|
|
4.0.1-preview.pr-76 | 141.13 KB | Mon, 20 Jul 2026 20:46:32 GMT | 0 |
|
||
|
|
4.0.0 | 141.2 KB | Mon, 20 Jul 2026 18:18:24 GMT | 0 |
|
||
|
|
3.9.2-preview.pr-74 | 141.23 KB | Mon, 20 Jul 2026 18:14:34 GMT | 0 |
|
||
|
|
3.9.1 | 155.8 KB | Sat, 18 Jul 2026 22:08:06 GMT | 0 |
|
||
|
|
3.9.1-preview.pr-73 | 155.82 KB | Sat, 18 Jul 2026 22:02:52 GMT | 0 |
|
||
|
|
3.9.0 | 143.13 KB | Fri, 17 Jul 2026 19:10:09 GMT | 0 |
|
||
|
|
3.8.14-preview.pr-72 | 143.16 KB | Fri, 17 Jul 2026 19:06:16 GMT | 0 |
|
||
|
|
3.8.13 | 142.03 KB | Wed, 01 Jul 2026 02:14:06 GMT | 5 |
|
||
|
|
3.8.13-preview.pr-68 | 142.05 KB | Wed, 01 Jul 2026 02:11:26 GMT | 8 |
|
||
|
|
3.8.12 | 141.98 KB | Wed, 01 Jul 2026 02:07:05 GMT | 10 |
|
||
|
|
3.8.11 | 142.02 KB | Wed, 01 Jul 2026 02:02:50 GMT | 7 |
|
||
|
|
3.8.10 | 141.98 KB | Wed, 01 Jul 2026 01:56:54 GMT | 8 |
|
||
|
|
3.8.10-preview.pr-66 | 142 KB | Wed, 01 Jul 2026 01:55:05 GMT | 8 |
|
||
|
|
3.8.10-preview.pr-65 | 142.05 KB | Tue, 30 Jun 2026 07:06:38 GMT | 8 |
|
||
|
|
3.8.9 | 142 KB | Tue, 30 Jun 2026 06:42:05 GMT | 8 |
|
||
|
|
3.8.9-preview.pr-64 | 142.02 KB | Tue, 30 Jun 2026 06:40:29 GMT | 10 |
|
||
|
|
3.8.8 | 142 KB | Sat, 27 Jun 2026 00:00:17 GMT | 11 |
|
||
|
|
3.8.8-preview.17 | 142.02 KB | Fri, 26 Jun 2026 23:58:41 GMT | 11 |
|
||
|
|
3.8.7 | 141.95 KB | Tue, 23 Jun 2026 23:56:42 GMT | 8 |
|
||
|
|
3.8.7-preview.16 | 141.97 KB | Tue, 23 Jun 2026 23:54:23 GMT | 12 |
|
||
|
|
3.8.6 | 141.93 KB | Tue, 23 Jun 2026 23:48:58 GMT | 8 |
|
||
|
|
3.8.6-preview.14 | 141.95 KB | Tue, 23 Jun 2026 23:47:10 GMT | 10 |
|
||
|
|
3.8.6-preview.13 | 141.93 KB | Tue, 23 Jun 2026 23:24:57 GMT | 11 |
|
||
|
|
3.8.5 | 141.92 KB | Tue, 23 Jun 2026 22:48:48 GMT | 8 |
|
||
|
|
3.8.5-preview.12 | 141.94 KB | Tue, 23 Jun 2026 22:46:06 GMT | 10 |
|
||
|
|
3.8.5-preview.11 | 141.96 KB | Tue, 23 Jun 2026 22:38:53 GMT | 8 |
|
||
|
|
3.8.5-preview.10 | 141.99 KB | Tue, 23 Jun 2026 22:25:48 GMT | 7 |
|
||
|
|
3.8.5-preview.9 | 141.96 KB | Tue, 23 Jun 2026 22:18:51 GMT | 12 |
|
||
|
|
3.8.5-preview.8 | 141.93 KB | Tue, 23 Jun 2026 22:06:47 GMT | 8 |
|
||
|
|
3.8.5-preview.7 | 141.96 KB | Tue, 23 Jun 2026 21:59:29 GMT | 10 |
|
||
|
|
3.8.5-preview.6 | 141.96 KB | Tue, 23 Jun 2026 21:52:02 GMT | 8 |
|
||
|
|
3.8.5-preview.5 | 141.96 KB | Tue, 23 Jun 2026 21:48:36 GMT | 11 |
|
||
|
|
3.8.4 | 141.91 KB | Tue, 23 Jun 2026 20:53:36 GMT | 10 |
|
||
|
|
3.8.4-preview.3 | 141.92 KB | Tue, 23 Jun 2026 20:49:05 GMT | 10 |
|
||
|
|
3.8.3 | 141.97 KB | Tue, 23 Jun 2026 16:16:29 GMT | 12 |
|
||
|
|
3.8.3-preview.1 | 141.98 KB | Tue, 23 Jun 2026 16:10:22 GMT | 8 |
|
||
|
|
3.8.2 | 141.94 KB | Tue, 23 Jun 2026 15:56:20 GMT | 11 |
|
||
|
|
3.8.2-preview.4 | 141.96 KB | Tue, 23 Jun 2026 15:54:27 GMT | 6 |
|
||
|
|
3.8.1 | 141.97 KB | Tue, 23 Jun 2026 15:46:10 GMT | 10 |
|
||
|
|
3.8.1-preview.3 | 141.98 KB | Tue, 23 Jun 2026 15:38:28 GMT | 12 |
|
||
|
|
3.8.1-preview.2 | 141.94 KB | Tue, 23 Jun 2026 15:15:31 GMT | 10 |
|
||
|
|
3.8.1-preview.1 | 141.96 KB | Tue, 23 Jun 2026 14:57:20 GMT | 9 |
|
||
|
|
3.8.0 | 141.42 KB | Fri, 24 Apr 2026 01:28:55 GMT | 16 |
|
||
|
|
3.8.0-preview.23 | 141.44 KB | Fri, 24 Apr 2026 01:25:57 GMT | 19 |
|
||
|
|
3.7.2 | 141.46 KB | Wed, 12 Nov 2025 04:26:21 GMT | 52 |
|
||
|
|
3.7.2-preview-18 | 141.47 KB | Wed, 12 Nov 2025 04:20:41 GMT | 45 |
|
||
|
|
3.7.1 | 141.45 KB | Wed, 12 Nov 2025 04:15:05 GMT | 37 |
|
||
|
|
3.7.1-preview-16 | 141.47 KB | Wed, 12 Nov 2025 04:12:58 GMT | 42 |
|
||
|
|
3.7.0 | 141.43 KB | Wed, 12 Nov 2025 04:06:54 GMT | 43 |
|
||
|
|
3.7.0-preview-14 | 141.45 KB | Wed, 12 Nov 2025 04:03:17 GMT | 45 |
|
||
|
|
3.6.7 | 53.59 KB | Tue, 11 Nov 2025 04:15:08 GMT | 49 |
|
||
|
|
3.6.7-preview-10 | 53.61 KB | Tue, 11 Nov 2025 04:12:50 GMT | 49 |
|
||
|
|
3.6.6 | 53.59 KB | Tue, 11 Nov 2025 03:55:05 GMT | 39 |
|
||
|
|
3.6.6-preview-6 | 53.6 KB | Tue, 11 Nov 2025 03:52:20 GMT | 39 |
|
||
|
|
3.6.6-preview-5 | 53.61 KB | Tue, 11 Nov 2025 03:25:05 GMT | 54 |
|
||
|
|
3.6.6-preview-4 | 53.6 KB | Tue, 11 Nov 2025 03:23:40 GMT | 41 |
|
||
|
|
3.6.6-preview-3 | 53.61 KB | Tue, 11 Nov 2025 03:18:56 GMT | 44 |
|
||
|
|
3.6.5 | 53.59 KB | Tue, 11 Nov 2025 03:15:40 GMT | 50 |
|
||
|
|
3.6.5-preview-1 | 53.61 KB | Tue, 11 Nov 2025 03:14:39 GMT | 43 |
|
||
|
|
3.6.4 | 53.59 KB | Mon, 10 Nov 2025 05:51:29 GMT | 36 |
|
||
|
|
3.6.4-preview-55 | 53.61 KB | Mon, 10 Nov 2025 05:49:20 GMT | 45 |
|
||
|
|
3.6.3 | 53.62 KB | Mon, 10 Nov 2025 05:27:43 GMT | 38 |
|
||
|
|
3.6.3-preview-52 | 53.64 KB | Mon, 10 Nov 2025 05:26:32 GMT | 36 |
|
||
|
|
3.6.3-preview-50 | 53.62 KB | Mon, 10 Nov 2025 05:24:32 GMT | 48 |
|
||
|
|
3.6.3-preview-48 | 53.62 KB | Mon, 10 Nov 2025 05:21:48 GMT | 47 |
|
||
|
|
3.6.3-preview-46 | 53.62 KB | Mon, 10 Nov 2025 05:04:19 GMT | 41 |
|
||
|
|
3.6.2 | 53.6 KB | Mon, 10 Nov 2025 04:40:53 GMT | 40 |
|
||
|
|
3.6.2-preview-44 | 53.62 KB | Mon, 10 Nov 2025 04:39:55 GMT | 37 |
|
||
|
|
3.6.1 | 53.59 KB | Mon, 10 Nov 2025 04:16:43 GMT | 42 |
|
||
|
|
3.6.1-preview-41 | 53.6 KB | Mon, 10 Nov 2025 04:14:34 GMT | 39 |
|
||
|
|
3.6.1-preview-40 | 53.61 KB | Mon, 10 Nov 2025 04:12:56 GMT | 46 |
|
||
|
|
3.6.0 | 53.59 KB | Mon, 10 Nov 2025 02:30:34 GMT | 45 |
|
||
|
|
3.6.0-preview-9 | 53.6 KB | Mon, 10 Nov 2025 02:08:16 GMT | 51 |
|
||
|
|
3.6.0-preview-5 | 53.6 KB | Mon, 10 Nov 2025 01:27:40 GMT | 40 |
|
||
|
|
3.6.0-preview-37 | 53.61 KB | Mon, 10 Nov 2025 03:51:54 GMT | 38 |
|
||
|
|
3.6.0-preview-13 | 53.61 KB | Mon, 10 Nov 2025 02:27:14 GMT | 30 |
|
||
|
|
3.6.0-preview-10 | 53.61 KB | Mon, 10 Nov 2025 02:11:26 GMT | 39 |
|
||
|
|
3.5.0 | 53.63 KB | Mon, 28 Jul 2025 04:08:52 GMT | 106 |
|
||
|
|
3.4.2 | 52.84 KB | Wed, 09 Nov 2022 02:14:02 GMT | 112 |
|
||
|
|
3.4.1 | 52.67 KB | Wed, 09 Nov 2022 01:07:38 GMT | 102 |
|
||
|
|
3.4.0 | 52.51 KB | Wed, 09 Nov 2022 00:39:54 GMT | 106 |
|
||
|
|
3.3.2 | 29.68 KB | Fri, 07 Oct 2022 02:45:46 GMT | 109 |
|
||
|
|
3.3.1 | 29.64 KB | Mon, 12 Sep 2022 22:13:58 GMT | 108 |
|
||
|
|
3.3.0 | 29.63 KB | Mon, 12 Sep 2022 04:08:47 GMT | 113 |
|
||
|
|
3.2.3 | 29.36 KB | Sat, 27 Aug 2022 04:46:00 GMT | 113 |
|
||
|
|
3.2.2 | 27.13 KB | Sat, 27 Aug 2022 03:54:13 GMT | 97 |
|
||
|
|
3.2.1 | 27.13 KB | Fri, 26 Aug 2022 16:06:23 GMT | 110 |
|
||
|
|
3.2.0 | 22.23 KB | Tue, 31 May 2022 03:44:42 GMT | 112 |
|
||
|
|
3.1.3 | 22.23 KB | Tue, 31 May 2022 03:43:55 GMT | 99 |
|
||
|
|
3.1.2 | 22.11 KB | Wed, 03 Nov 2021 00:13:53 GMT | 103 |
|
||
|
|
3.1.1 | 22.11 KB | Wed, 03 Nov 2021 00:13:16 GMT | 130 |
|
||
|
|
3.1.0 | 22.01 KB | Sun, 12 Sep 2021 23:02:36 GMT | 89 |
|
||
|
|
3.0.2 | 21.89 KB | Wed, 08 Sep 2021 22:06:29 GMT | 99 |
|
||
|
|
3.0.1 | 22.25 KB | Sat, 07 Aug 2021 03:58:59 GMT | 109 |
|
||
|
|
3.0.0 | 22.26 KB | Wed, 04 Aug 2021 03:24:40 GMT | 105 |
|
||
|
|
2.1.4 | 22.19 KB | Mon, 05 Jul 2021 04:09:39 GMT | 103 |
|
||
|
|
2.1.3 | 22.2 KB | Tue, 22 Jun 2021 01:11:26 GMT | 112 |
|
||
|
|
2.1.2 | 21.97 KB | Mon, 21 Jun 2021 03:39:03 GMT | 95 |
|
||
|
|
2.1.1 | 21.54 KB | Mon, 07 Jun 2021 00:31:25 GMT | 97 |
|
||
|
|
2.1.0 | 17.69 KB | Fri, 04 Jun 2021 01:21:40 GMT | 124 |
|
||
|
|
2.0.13 | 17.4 KB | Thu, 03 Jun 2021 23:42:27 GMT | 113 |
|
||
|
|
2.0.12 | 15.73 KB | Tue, 25 May 2021 20:18:10 GMT | 101 |
|
||
|
|
2.0.11 | 15.7 KB | Fri, 21 May 2021 19:27:28 GMT | 124 |
|
||
|
|
2.0.10 | 15.71 KB | Sun, 16 May 2021 18:13:02 GMT | 115 |
|
||
|
|
2.0.9 | 15.19 KB | Fri, 14 May 2021 03:04:13 GMT | 107 |
|
||
|
|
2.0.8 | 15.13 KB | Sun, 04 Apr 2021 22:17:20 GMT | 95 |
|
||
|
|
2.0.7 | 15.08 KB | Sat, 03 Apr 2021 19:30:12 GMT | 100 |
|
||
|
|
2.0.6 | 15.01 KB | Fri, 02 Apr 2021 23:07:54 GMT | 118 |
|
||
|
|
2.0.5 | 14.94 KB | Sun, 28 Mar 2021 23:37:19 GMT | 105 |
|
||
|
|
2.0.4 | 14.79 KB | Sun, 28 Mar 2021 20:25:09 GMT | 103 |
|
||
|
|
2.0.3 | 14.79 KB | Sat, 27 Mar 2021 22:28:58 GMT | 96 |
|
||
|
|
2.0.2 | 14.77 KB | Sat, 27 Mar 2021 20:42:54 GMT | 98 |
|
||
|
|
2.0.1 | 14.32 KB | Fri, 19 Mar 2021 22:02:32 GMT | 103 |
|
||
|
|
2.0.0 | 14.3 KB | Fri, 19 Mar 2021 03:53:07 GMT | 98 |
|
||
|
|
1.2.5 | 14.57 KB | Sun, 14 Mar 2021 03:25:47 GMT | 99 |
|
||
|
|
1.2.4 | 14.55 KB | Sun, 10 Jan 2021 22:43:29 GMT | 109 |
|
||
|
|
1.2.3 | 14.47 KB | Sun, 10 Jan 2021 22:23:26 GMT | 108 |
|
||
|
|
1.2.2 | 14.33 KB | Tue, 01 Sep 2020 21:02:26 GMT | 112 |
|
||
|
|
1.2.1 | 14.28 KB | Tue, 18 Aug 2020 00:42:25 GMT | 120 |
|
||
|
|
1.2.0 | 14.28 KB | Sun, 09 Aug 2020 04:20:35 GMT | 101 |
|
||
|
|
1.1.1 | 13.06 KB | Wed, 05 Aug 2020 13:50:00 GMT | 99 |
|
||
|
|
1.1.0 | 12.8 KB | Sun, 12 Jul 2020 20:27:08 GMT | 116 |
|
||
|
|
1.0.10 | 12.62 KB | Sun, 19 Apr 2020 01:29:34 GMT | 99 |
|
||
|
|
1.0.9 | 12.57 KB | Tue, 14 Apr 2020 02:20:28 GMT | 96 |
|
||
|
|
1.0.8 | 12.5 KB | Tue, 14 Apr 2020 02:04:15 GMT | 91 |
|
||
|
|
1.0.7 | 12.42 KB | Sat, 11 Apr 2020 22:08:50 GMT | 109 |
|
||
|
|
1.0.6 | 12.42 KB | Sat, 11 Apr 2020 22:07:15 GMT | 113 |
|
||
|
|
1.0.5 | 13.78 KB | Fri, 20 Dec 2019 01:02:18 GMT | 97 |
|
||
|
|
1.0.4 | 12.82 KB | Mon, 16 Dec 2019 00:34:21 GMT | 90 |
|
||
|
|
1.0.3 | 13.39 KB | Sun, 15 Dec 2019 06:08:32 GMT | 108 |
|
||
|
|
1.0.2 | 13.16 KB | Mon, 25 Nov 2019 04:32:25 GMT | 102 |
|
||
|
|
1.0.1 | 13.2 KB | Mon, 18 Nov 2019 03:29:44 GMT | 100 |
|
||
|
|
1.0.0 | 12.76 KB | Thu, 10 Oct 2019 16:30:25 GMT | 102 |
|


