TheSalLab.GeneralReturnValues
2.0.0
See the version list below for details.
dotnet add package TheSalLab.GeneralReturnValues --version 2.0.0
NuGet\Install-Package TheSalLab.GeneralReturnValues -Version 2.0.0
<PackageReference Include="TheSalLab.GeneralReturnValues" Version="2.0.0" />
paket add TheSalLab.GeneralReturnValues --version 2.0.0
#r "nuget: TheSalLab.GeneralReturnValues, 2.0.0"
// 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 | Versions 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. |
-
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.