Common library for Web, Desktop and Mobile (MAUI) applications.
NuvTools.Common is a cross-platform utility library for .NET 8 and .NET 9, designed to streamline development for Web, Desktop, and Mobile (MAUI) applications. It provides a rich set of reusable components, extension methods, and helpers that address frequent programming needs, focusing on consistency, safety, and productivity.
NuvTools.Common provides a suite of utilities and helpers to simplify development across .NET 8 and .NET 9 projects, including Web, Desktop, and Mobile (MAUI) applications. Its main features are:
- Purpose: Standardizes operation result handling with support for success, error, and validation outcomes.
- Key Types:
IResult,IResult<T>,Result,Result<T>,MessageDetail,ResultType. - Highlights: Factory methods for creating results, structured messages, and easy integration with logging.
- Purpose: Safely parse strings to numeric types (
long,int,short,decimal) with null or zero fallback. - Highlights: Reduces boilerplate and handles invalid input gracefully.
- Purpose: Centralized management of file content types using annotated enums.
- Key Types:
ContentTypes.Enumerationwith extension methods for retrieving file extension, MIME type, and friendly name. - Highlights: Simplifies file handling and metadata retrieval.
- Purpose: Streamlines query string generation and parsing for web APIs.
- Key Methods:
GetQueryString(),ParseQueryString(). - Highlights: Supports complex objects, collections, and edge cases in query string manipulation.
- Purpose: Facilitates JSON serialization and deserialization, including support for enums and nested models.
- Highlights: Handles complex object graphs and collections.
- Purpose: Simplifies working with enums and attributes, such as retrieving display names, descriptions, and custom metadata.
- Highlights: Extension methods for extracting information from enums using attributes like
DisplayAttribute.
- Purpose: Provides helpers for parsing, formatting, and manipulating dates and times.
- Highlights: Methods for converting between different date/time representations and handling nullable values.
- Purpose: Adds convenience methods for working with collections, lists, and LINQ queries.
- Highlights: Safe access, filtering, mapping, and transformation utilities.
- Purpose: Facilitates file operations, such as reading, writing, and managing file paths and content.
- Highlights: Utilities for handling file streams, directories, and file type detection.
- Purpose: Enhances string manipulation with methods for formatting, parsing, validation, and conversion.
- Highlights: Null-safe operations, trimming, case conversion, and more.
- Purpose: Provides helpers for runtime type inspection and dynamic member access.
- Highlights: Methods for getting property values, types, and attributes dynamically.
- Purpose: Supports data validation scenarios, including model and property validation.
- Highlights: Methods for checking required fields, data annotations, and custom validation logic.
Benefits:
- Consistent patterns for error/success handling.
- Strongly-typed APIs for safer code.
- Reduces repetitive code and runtime errors.
- Designed for modern .NET and C# features.
For more details, refer to the XML documentation in the source code or explore the relevant namespaces.