Mhlabs.WebApi.JsendActionFilter
4.0.0
dotnet add package Mhlabs.WebApi.JsendActionFilter --version 4.0.0
NuGet\Install-Package Mhlabs.WebApi.JsendActionFilter -Version 4.0.0
<PackageReference Include="Mhlabs.WebApi.JsendActionFilter" Version="4.0.0" />
paket add Mhlabs.WebApi.JsendActionFilter --version 4.0.0
#r "nuget: Mhlabs.WebApi.JsendActionFilter, 4.0.0"
// Install Mhlabs.WebApi.JsendActionFilter as a Cake Addin #addin nuget:?package=Mhlabs.WebApi.JsendActionFilter&version=4.0.0 // Install Mhlabs.WebApi.JsendActionFilter as a Cake Tool #tool nuget:?package=Mhlabs.WebApi.JsendActionFilter&version=4.0.0
Mhlabs.WebApi.JsendActionFilter
Action filter for optionally wrapping a response in JSend format.
See https://labs.omniti.com/labs/jsend.
To enable, add the filter as middleware.
services.AddMvc(s =>
{
s.AddJSendResponseFormat();
});
Example usage:
[HttpGet]
public ActionResult<bool> GetIt(string id, CancellationToken cancellationToken)
{
if (string.IsNullOrWhiteSpace(id))
{
return this.Error("NO_ID", "Didn't get it.");
}
return true;
}
[HttpGet]
public async Task<DtoObject> Get(string id, CancellationToken cancellationToken)
{
if (string.IsNullOrEmpty(id))
{
this.Fail("INVALID_ID", "Id is invalid");
}
var dto = await _handler.GetObject(id, cancellationToken);
if (dto == null)
{
this.Fail("NOT_FOUND");
}
return dto;
}
Pushing a new version
Set the Version
number in the <a href="https://github.com/mhlabs/Mhlabs.WebApi.JsendActionFilter/blob/master/Mhlabs.WebApi.JsendActionFilter/Mhlabs.WebApi.JsendActionFilter.csproj"> .csproj-file</a> before pushing. If an existing version is pushed the <a href="https://github.com/mhlabs/Mhlabs.WebApi.JsendActionFilter/actions">build will fail</a>.
Publish pre-release packages on branches to allow us to test the package without merging to master
- Create a new branch
- Update
Version
number and add-beta
postfix (can have .1, .2 etc. at the end) - Make any required changes updating the version as you go
- Test beta package in solution that uses package
- Create PR and get it reviewed
- Check if there are any changes on the branch you're merging into. If there are you need to rebase those changes into yours and check that it still builds
- As the final thing before merging update version number and remove post fix
Product | Versions 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. |
.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. |
-
.NETStandard 2.1
- Microsoft.AspNetCore.Mvc (>= 2.2.0)
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 |
---|---|---|
4.0.0 | 2,052 | 1/13/2023 |
3.3.0 | 3,755 | 4/13/2021 |
3.2.0 | 484 | 4/13/2021 |
3.1.0 | 9,525 | 11/14/2019 |
3.0.0 | 3,931 | 5/17/2019 |
2.1.0 | 3,812 | 1/7/2019 |
2.0.0 | 961 | 1/4/2019 |
1.2.1 | 1,857 | 11/13/2018 |
1.2.0 | 959 | 11/8/2018 |
1.1.0 | 2,101 | 9/25/2018 |
1.0.6 | 8,344 | 10/19/2017 |
1.0.5 | 3,322 | 6/8/2017 |
1.0.4 | 951 | 6/8/2017 |
1.0.3 | 946 | 6/8/2017 |
1.0.2 | 975 | 6/8/2017 |
1.0.1 | 955 | 6/7/2017 |
1.0.0 | 1,048 | 6/2/2017 |