Appco.ServiceProtocol 1.0.0

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

Appco.ServiceProtocol

A library for standardized service responses in .NET applications, providing consistent status and content handling for API and service layers.

Installation

Install via NuGet Package Manager: Install-Package Appco.ServiceProtocol

Or using the .NET CLI: dotnet add package Appco.ServiceProtocol

Requirements

  • .NET 9 or later

Usage

Import the namespace in your service or controller: using Appco.ServiceProtocol;

Exemples

	// Example 1: Internal error response without content
	var internalErrorResponse = InternalError("An unexpected error occurred.");
	// internalErrorResponse.Status is StatusInternalError, Message = "An unexpected error occurred."

	// Example 2: Internal error response with content
	var internalErrorWithContent = InternalError("Database failure.", "Error details here");
	// internalErrorWithContent.Status is StatusInternalError, Message = "Database failure."
	// internalErrorWithContent.Content = "Error details here"

	// Example 3: Not found response
	var notFoundResponse = NotFound("User not found.");
	// notFoundResponse.Status is StatusNotFound, Message = "User not found."

	// Example 4: Not found response with content
	var notFoundWithContent = NotFound("Order not found.", 12345);
	// notFoundWithContent.Status is StatusNotFound, Message = "Order not found."
	// notFoundWithContent.Content = 12345

	// Example 5: Success response (OK)
	var okResponse = Ok();
	// okResponse.Status is StatusOk, Message = "Ok."

	// Example 6: Success response (OK) with custom message
	var okWithMessage = Ok("Operation completed successfully.");
	// okWithMessage.Status is StatusOk, Message = "Operation completed successfully."

	// Example 7: Success response (OK) with content
	var okWithContent = Ok("Data loaded.", "Sample data");
	// okWithContent.Status is StatusOk, Message = "Data loaded."
	// okWithContent.Content = "Sample data"

	// Example 8: Created response
	var createdResponse = Created("Resource created.");
	// createdResponse.Status is StatusCreated, Message = "Resource created."

	// Example 9: Updated response with content
	var updatedWithContent = Updated("Resource updated.", "Updated value");
	// updatedWithContent.Status is StatusUpdated, Message = "Resource updated."
	// updatedWithContent.Content = "Updated value"

	// Example 10: Deleted response
	var deletedResponse = Deleted("Resource deleted.");
	// deletedResponse.Status is StatusDeleted, Message = "Resource deleted."

License

This project is licensed under the MIT License.

Support

For questions or issues, please open an issue on the repository or contact the maintainers.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0

    • No dependencies.

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.0.2 700 10/7/2025
1.0.1 236 9/25/2025
1.0.0 202 9/24/2025