TheSalLab.GeneralReturnValues 2.0.0

There is a newer version of this package available.
See the version list below for details.
The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package TheSalLab.GeneralReturnValues --version 2.0.0
NuGet\Install-Package TheSalLab.GeneralReturnValues -Version 2.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="TheSalLab.GeneralReturnValues" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TheSalLab.GeneralReturnValues --version 2.0.0
#r "nuget: TheSalLab.GeneralReturnValues, 2.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.
// Install TheSalLab.GeneralReturnValues as a Cake Addin
#addin nuget:?package=TheSalLab.GeneralReturnValues&version=2.0.0

// Install TheSalLab.GeneralReturnValues as a Cake Tool
#tool nuget:?package=TheSalLab.GeneralReturnValues&version=2.0.0

GeneralReturnValues

Examples(实例)

using System.Text.Json;
using TheSalLab.GeneralReturnValues;

ServiceResult FunctionThatSuccess() {
    return ServiceResult.CreateSuccessResult();
}

ServiceResult FunctionThatEncountersAnException() {
    var e = new Exception();
    return ServiceResult.CreateExceptionResult(e, e.Message);
}

ServiceResult<int> FunctionThatReturnsAnInt() {
    return ServiceResult<int>.CreateSuccessResult(256);
}

ServiceResultViewModel FunctionThatReturnsAServiceResultViewModel() {
    return ServiceResult.CreateSuccessResult().ToServiceResultViewModel();
}

void ServiceResultViewModelCanBeSerializedAndDeserialized() {
    var e = new Exception();
    var serviceResult = ServiceResult.CreateExceptionResult(e, e.Message);
    var json =
        JsonSerializer.Serialize(serviceResult.ToServiceResultViewModel());

    var serviceResultViewModel = JsonSerializer
        .Deserialize<ServiceResultViewModel>(json);
    serviceResult = serviceResultViewModel.ToServiceResult();
}

Console.WriteLine("Hello World!");

License

GeneralReturnValues is licensed under Attribution 4.0 International (CC BY 4.0).

For attribution:

Zhang, Yin. GeneralReturnValues. Northeastern University.

Besides, please let me know if you plan to use GeneralReturnValues in your app by sending an email to zhangyin@mail.neu.edu.cn

Thanks a lot!

许可证

GeneralReturnValues采用署名4.0国际(CC BY 4.0)许可证。

署名请引用:

张引.GeneralReturnValues.东北大学.

除此之外,如果你计划使用GeneralReturnValues,请发送邮件到zhangyin@mail.neu.edu.cn告知我。

谢谢!

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

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on TheSalLab.GeneralReturnValues:

Package Downloads
Sada.AI.Client

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.0 107 5/6/2024
1.0.0 412 3/18/2023