RouteBuilder

Route builder helper class to create routes based on input parameters.

Description

The RouteBuilder class allows you to create routes based on input paramters.

Important points

  • It might be useful in rest clients for microservices built on top of rest operations.

Instance methods

AddParameter

Adds a parameter.

public RouteBuilder AddParameter(string name, string value)

  • name: string - parameter’s name
  • value: string - parameter’s value
  • returns: RouteBuilder - route builder

AddFilterParams

Adds a parameter filter.

public RouteBuilder AddFilterParams(FilterParams filter)

AddPagingParams

Adds pagin parameters.

public RouteBuilder AddPagingParams(PagingParams paging)

AddSortParams

Adds sorting paramters.

public RouteBuilder AddSortParams(SortParams sort)

AddProjectionParams

Adds projection paramters.

public RouteBuilder AddProjectionParams(ProjectionParams projection)

Build

TODO: add description

public string Build()

  • returns: string - TODO: add description

Static methods

Builds and creates a route.

public static RouteBuilder Route(string route)

  • route: string - created route

Examples

var route = RouteBuilder
    .Route("get_dummies")
    .AddFilterParams(filter)
    .AddPagingParams(paging)
    .AddSortParams(sort)
    .Build()
...