BitzArt/Flux

Flux.REST: Query parameters

Closed this issue · 1 comments

Allow users to configure query parameters when making REST requests.

Currently query parameters can be implemented something like this:

services.AddFlux(x =>
{
    x.AddService("my-api")
    .UsingRest("my-api-url")

    .AddSet<MyDto>()
        .WithEndpoint("entities{query}");
});

var flux = services.GetRequiredService<IFluxContext>();
var set = flux.Set<MyDto>();

var query = "?param1=value1&param2=value2";

var list = await set.GetAllAsync(query);

This is not a perfect solution, but it should do the trick for now.

Closing this for now, will consider reopening in the future once more functionality is built around this in order to support more advanced approaches.