Skip to content

DmitryFillo/UriPathScanf

Repository files navigation

URI path scanf

image

Reversed String.Format for URI path.

You can describe URI path like /some/path/{id}/some.html and parse it to the model like { type: "someUri", id: [id] }. Supports query string.

Motivation

This package is useful for you if:

  • You need to get metadata (identifiers) from URI paths, e.g. to provide API to not to couple some parts of the system with UI specific information.
  • You're going to encode data in "URI path format", e.g. /{identifierOne}/{identifierTwo}, and then you're going to decode them to IDictionary<string, string> or models.

Install

Install UriPathScanf via nuget.

Usage

Typed descriptors:

Diffrenently typed descriptors:

Typed and non-typed descriptors:

Examples

Check examples in the project UriPathScanf.Example.