n2.core.abstractions 1.2.1

dotnet add package n2.core.abstractions --version 1.2.1
                    
NuGet\Install-Package n2.core.abstractions -Version 1.2.1
                    
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="n2.core.abstractions" Version="1.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="n2.core.abstractions" Version="1.2.1" />
                    
Directory.Packages.props
<PackageReference Include="n2.core.abstractions" />
                    
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 n2.core.abstractions --version 1.2.1
                    
#r "nuget: n2.core.abstractions, 1.2.1"
                    
#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.
#addin nuget:?package=n2.core.abstractions&version=1.2.1
                    
Install n2.core.abstractions as a Cake Addin
#tool nuget:?package=n2.core.abstractions&version=1.2.1
                    
Install n2.core.abstractions as a Cake Tool

N2.Core.Abstractions

This repository provides the abstractions for generic core utilities for .NET-based projects.

N2.Core

The N2.Core namespace provides a set of models and utilities for handling responses, data structures, and other core abstractions in a .NET-based application.

Components

  • IResult<T>: Represents the result of an operation, including properties like Type, Success, Message, and a generic Value.
  • IRequestResult<T>: Extends IResult<T> to include additional properties or methods specific to request results.
  • SelectItem<T>: Represents a selectable item with a generic value and display text.
  • SelectItemList<T>: A collection of SelectItem<T> objects, providing methods for managing selectable items.
  • ValidationResult<T>: Represents the result of a validation operation, including a generic value and validation messages.

Services

  • IEmailService: Interface for sending emails.
  • ISettingsService: Interface for managing application settings.
  • ILogService: Interface for logging application events.
  • IBackgroundWorker: Interface for managing background tasks.
  • IAzureFunctionClient: Interface for interacting with Azure Functions.
  • IActivityLogger: Interface for logging user activities.
  • IActivityLoggerFactory: Factory for creating instances of IActivityLogger.
  • ITextService: Interface for text manipulation and formatting.
  • IStdOut: Interface for standard output operations.
  • IValidation: Interface for validating objects or data.
  • IHtmlString: Interface for working with HTML strings.
  • IHtmlDisplayPart: Interface for rendering parts of an HTML display.

Utilities

  • HtmlString: Represents an HTML string.
  • ErrorCode: Enum defining error codes for application operations.
  • PagingInfo: Represents pagination information for data queries.
  • SelectOption: Represents a selectable option in a dropdown or list.
  • SelectOptionsExtensions: Extension methods for working with SelectOption objects.

N2.Core.Dms

The N2.Core.Dms namespace provides abstractions for handling document management systems (DMS) in a .NET-based application. It includes interfaces and models to simplify DMS operations.

Components

  • IDocument: Represents a document in the DMS, including properties like Id, Name, and ContentType.

N2.Core.Http

The N2.Core.Http namespace provides abstractions for handling HTTP requests and responses in a .NET-based application. It includes interfaces and models to simplify HTTP communication.

Components

  • IHttpRequest: Represents an abstraction for an HTTP request, providing properties and methods to access request data.
  • IHttpResponse: Represents an abstraction for an HTTP response, allowing manipulation of response data.
  • IHttpResult: Defines the structure of an HTTP result, including status codes and response content.
  • IHttpClient: Provides an abstraction for making HTTP requests, supporting dependency injection and testability.

Usage

These abstractions can be used to create testable and reusable HTTP communication layers in your application. For example:

N2.Core.Entity

This namespace contains the interfaces and classes that simplify the use of a database context in a .NET Core application.

Components

  • IDbBaseModel : This interface is used to define the base properties of a model class that is used in the database context.
  • IDbContext : This interface is used to define the base properties of a database context class.
  • IBasicListModel : This interface is used to define the base properties of a model class that is used in the database context as a list of items.
  • IChangeLog : This interface is used to define the base properties of a model class that is used in the database context as a change log.
  • IConnectionStringService : Helper service to find a connection string based on the environment or user context.
  • IModifiable : This interface is used to define the base properties of a model class that is used in the database context as a modifiable item.
  • IDesignComponent : This interface is used to define the base functionality for a component that is used to manage a specific data model.
  • ICoreDataContext : This interface is used to define the base properties of a database context class that is used to manage the core data models.

N2.Core.Identity

The N2.Core.Identity namespace provides abstractions and models for managing user authentication, roles, and access control in a .NET-based application.

Components

  • IAuthenticator: Defines methods for authenticating users and managing authentication tokens.
  • IIdentityUser: Represents a user in the identity system, including properties like username, email, and roles.
  • IIdentityRole: Represents a role in the identity system, including associated permissions.
  • IUserManager: Provides methods for managing users, such as creating, updating, and deleting user accounts.
  • IUserContext: Represents the current user's context, including identity and access information.
  • IUserContextFactory: Factory for creating instances of IUserContext.
  • IUserAccess: Defines methods for checking user permissions and access rights.
  • RoleRight: Represents the relationship between roles and their associated rights.
  • SystemRoles: Provides predefined system roles for common use cases.
  • UserLogin: Represents a user's login information, such as login provider and key.
  • UserAlert: Represents alerts or notifications for a user.
  • Priority: Enum defining priority levels for user-related operations or alerts.

Usage

These abstractions can be used to implement authentication and authorization in your application. For example, you can create a custom user manager by implementing the IUserManager interface and use the IAuthenticator to handle user login and token generation.

N2.Core.Models

The N2.Core.Models namespace provides a set of models and utilities for handling responses, data structures, and other core abstractions in a .NET-based application.

Components

  • ResponseModel: A base class for response models, providing properties like Type, Message, and Success to represent the status of an operation.
  • StringResponseModel: A response model for operations that return a string value. It includes factory methods like NoContent, Fail, Accept, and NoChange for common response scenarios.
  • GuidResponseModel: A response model for operations that return a GUID value.
  • AcknowledgeResponse: Represents a response with an acknowledgment code and message.
  • ResponseLevel: Enum defining levels of response severity, such as Info, Warning, and Error.
  • EditMode: Enum representing different modes of editing, such as Create, Update, and Delete.
  • AcknowledgeCode: Enum defining acknowledgment codes for operations, such as Success, Failure, and Pending.
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. 
.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 (5)

Showing the top 5 NuGet packages that depend on n2.core.abstractions:

Package Downloads
N2.Core

Core functionality for any application

n2.core.entity.abstractions

Abstractions for standardized use of data contexts

n2.core.identity.abstractions

Interfaces and classes for standardized use of identity

n2.core.entity

Library for standardized use of data contexts

N2.Documents

Dociument management and process information services

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.1 0 4/24/2025
1.2.0 141 4/18/2025
1.1.3-pre-0417-b 251 4/17/2025 1.1.3-pre-0417-b is deprecated.
1.1.0 188 4/15/2025
1.0.9 450 8/5/2024
1.0.3 370 5/7/2024
1.0.2 116 5/6/2024
1.0.1 119 5/6/2024
1.0.0 181 3/29/2024