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;
}
Set the Version
number in the .csproj-file before pushing. If an existing version is pushed the build will fail.
- 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