Skip to content

Many of the builder methods add duplicate query parameters #373

@Nordeast

Description

@Nordeast

There are some more user friendly ways to construct this library that I think should be added. For instance the implementation for many of the builder methods simply just keep appending the same query parameter to the list even if a param has already been added before. Ideally the library would find and update the parameter rather than add a duplicate. Consider this code:

var query = QueryBuilder<SitemapItem>.New.ContentTypeIs("myType");
query.Limit(100);
query.Limit(200);
Console.WriteLine(query.Build()); 

// outputs
// ?content_type=myType&limit=100&limit=200

The desired outcome would be ?content_type=myType&limit=200 as adding the parameter on twice produces an invalid query and allowing the the limit to be updated can simply some code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions