Custom Variables
You can add custom variables to your endpoint configurations:
services.AddFlux(flux =>
{
flux.AddService("service1")
.UsingRest("https://test.com")
.AddSet<YourModel>()
.WithEndpoint("{a}/{b}");
});
Provide variable values when calling an appropriate method:
var a = "first";
var b = "second";
var result = await setContext.GetAsync(1, a, b); // Will make an http request to https://test.com/first/second/1
Custom Page endpoint with parent id example:
Flux configuration:
services.AddFlux(flux =>
{
flux.AddService("service1")
.UsingRest("https://test.com")
.AddSet<Book>()
.WithPageEndpoint("authors/{authorId}/books");
});
Usage:
var books = fluxContext.Set<Book>();
var offset = 0;
var limit = 10;
var authorId = 15;
var booksPage = await books.GetPage(offset, limit, authorId); // https://test.com/authors/15/books?offset=0&limit=10