Sciensoft.Hateoas 3.2.0

.NET Standard 2.1
dotnet add package Sciensoft.Hateoas --version 3.2.0
NuGet\Install-Package Sciensoft.Hateoas -Version 3.2.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="Sciensoft.Hateoas" Version="3.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Sciensoft.Hateoas --version 3.2.0
#r "nuget: Sciensoft.Hateoas, 3.2.0"
#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 Sciensoft.Hateoas as a Cake Addin
#addin nuget:?package=Sciensoft.Hateoas&version=3.2.0

// Install Sciensoft.Hateoas as a Cake Tool
#tool nuget:?package=Sciensoft.Hateoas&version=3.2.0

Sciensoft.Hateoas Build Status Quality Gate Status Security Rating Vulnerabilities

Please visit Sciensoft.Hateoas project at GitHub for more details and full documentation.


  • Collections result with links,
  • Json.NET and System.Text.Json settings support,
  • Self-link generation,
  • Named Route link generation,
  • Custom link generation with support to path override,
  • External links configuration,
  • Configuration with Lambda Expression,
  • Attribute Routing support, and
  • Conventional Routing support.


  • Add support for extending link generation.
  • Add support to bypass model link generation.
  • Add support to .NET Authorization.
  • Add support to Content Negotiation type in the read-model.

Get Started

Sciensoft.Hateoas gets installed using Nuget package manager.

Install-Package Sciensoft.Hateoas

Or dotnet CLI dotnet add package Sciensoft.Hateoas.


Using a fluent language, allows you to easily configure by adding the service to .NET Core dependency injection pipeline.

public void ConfigureServices(IServiceCollection services)
    .AddLinks(policy =>
        .AddPolicy<BookViewModel>(model =>
            .AddSelf(m => m.Id, "This is a GET self link.")
            .AddRoute(m => m.Id, BookController.UpdateBookById)
            .AddRoute(m => m.Id, BookController.DeleteBookById)
            .AddCustomPath(m => m.Id, "Edit", method: HttpMethods.Post, message: "Edits resource")
            .AddCustomPath(m => $"/change/resource/state/?id={m.Id}", "ChangeResourceState", method: HttpMethods.Post, message: "Any operation in your resource.")
            .AddExternalUri(m => m.Id, "", "Custom Domain External Link")
            .AddExternalUri(m => $"/search?q={m.Title}", "", "Google Search External Links", message: "This will do a search on Google engine.");

Here is how your controller looks like, no additional injection or attribute decoration is required. Please check our Sample Project out!

public class BookController : ControllerBase
    public const string UpdateBookById = nameof(UpdateBookById);
    public const string DeleteBookById = nameof(DeleteBookById);

    public ActionResult<IEnumerable<BookViewModel>> Get()
    { /* Code omitted for simplicity */ }

    public ActionResult<BookViewModel> Get(Guid id)
    { /* Code omitted for simplicity */ }

    public IActionResult Post([FromBody] BookViewModel book)
    { /* Code omitted for simplicity */ }

    [HttpPut("{id:guid}", Name = UpdateBookById)]
    public IActionResult Put(Guid id, [FromBody] BookViewModel book)
    { /* Code omitted for simplicity */ }

    [HttpDelete("{id:guid}", Name = DeleteBookById)]
    public IActionResult Delte(Guid id)
    { /* Code omitted for simplicity */ }

JSON Result:

    "Id": "8f46d29e-6c0d-4511-85e7-b1d7ae42934a",
    "Title": "The Girl Who Lived: A Thrilling Suspense Novel",
    "Author": "Christopher Greyson",
    "Tags": [
    "Reference": null,
    "links": [
            "method": "GET",
            "uri": "http://localhost:6080/api/books/83389205-b1c9-4523-a3bb-85d7255546f9",
            "relation": "Self",
            "message": "This is a GET self link."
            "method": "PUT",
            "uri": "http://localhost:6080/api/books/83389205-b1c9-4523-a3bb-85d7255546f9",
            "relation": "UpdateBookById",
            "message": null
            "method": "DELETE",
            "uri": "http://localhost:6080/api/books/83389205-b1c9-4523-a3bb-85d7255546f9",
            "relation": "DeleteBookById",
            "message": null
            "method": "POST",
            "uri": "http://localhost:6080/api/books/83389205-b1c9-4523-a3bb-85d7255546f9",
            "relation": "Edit",
            "message": "Edits resource"
            "method": "POST",
            "uri": "http://localhost:6080/change/resource/state/%3fid=83389205-b1c9-4523-a3bb-85d7255546f9",
            "relation": "ChangeResourceState",
            "message": "Any operation in your resource."
            "method": "GET",
            "uri": "",
            "relation": "Custom Domain External Link",
            "message": null
            "method": "GET",
            "uri": " Girl Beneath the Sea (Underwater Investigation Unit Book 1)",
            "relation": "Google Search External Links",
            "message": "This will do a search on Google engine."
Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.1
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

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
3.2.0 3,530 5/13/2020
3.1.0 342 5/7/2020
3.0.2 369 5/1/2020
3.0.1 347 5/1/2020
3.0.0 337 5/1/2020
1.0.5 781 3/7/2019
1.0.0 773 3/7/2019