Spherus.ServiceResponse 1.0.7

Install-Package Spherus.ServiceResponse -Version 1.0.7
dotnet add package Spherus.ServiceResponse --version 1.0.7
<PackageReference Include="Spherus.ServiceResponse" Version="1.0.7" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Spherus.ServiceResponse --version 1.0.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Spherus.ServiceResponse, 1.0.7"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Spherus.ServiceResponse as a Cake Addin
#addin nuget:?package=Spherus.ServiceResponse&version=1.0.7

// Install Spherus.ServiceResponse as a Cake Tool
#tool nuget:?package=Spherus.ServiceResponse&version=1.0.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Spherus.ServiceResponse

This repository contains a simple generic Service Response using .NET Standard.

NuGet

Link to the NuGet package

Package Manager: PM> Install-Package Spherus.ServiceResponse -Version 1.0.4 <br /> .NET CLI: > dotnet add package Spherus.ServiceResponse --version 1.0.4

How to use:



//Generic use
ServiceResponse<string> HelloWorld()
{
	ServiceResponse<string> result = new ServiceResponse<string>();

	try
	{
		result.ObjectResult = "Hello World";
		result.Status.Code = 0;
		result.Status.Message = "Success";
	}
	catch (System.Exception ex)
	{
		result.ObjectResult = null;
		result.Status.Code = 1;
		result.Status.Message = ex.Message;
	}

	return result;
}


//Nongeneric use
ServiceResponse HelloWorld()
{
	ServiceResponse result = new ServiceResponse();

	try
	{
		result.Status.Code = 0;
		result.Status.Message = "Success";
	}
	catch (System.Exception ex)
	{
		result.Status.Code = 1;
		result.Status.Message = ex.Message;
	}

	return result;
}

  • .NETStandard 2.1

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Spherus.ServiceResponse:

Package Downloads
Spherus.Notifications

Base package for Notifications. Use it only for creating your own notifications systems based on this package.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.7 256 1/20/2020
1.0.6 334 3/29/2019
1.0.5 423 12/2/2018
1.0.4 1,355 12/17/2017
1.0.3 824 12/16/2017
1.0.2 636 12/16/2017
0.1.0 854 8/28/2017