Skip to content

Commit

Permalink
reivew QBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
ZEXSM committed Feb 10, 2024
1 parent 8ec3265 commit 0692da0
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions src/OData.QueryBuilder/Builders/QBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,10 @@ namespace OData.QueryBuilder.Builders
internal class QBuilder
{
private readonly StringBuilder _builder;
private readonly StringBuilder _templateBuilder;

private readonly bool _includeTemplate;

public QBuilder(string baseUrl, bool includeTemplate = false)
public QBuilder(string baseUrl)
{
_builder = new StringBuilder(baseUrl);
_templateBuilder = new StringBuilder(baseUrl);
_includeTemplate = includeTemplate;
}

public QBuilder(bool includeTemplate = false)
{
_builder = new StringBuilder();
_templateBuilder = new StringBuilder();
_includeTemplate = includeTemplate;
}

public bool IsEmpty() => _builder.Length == 0;
Expand All @@ -29,23 +17,13 @@ public QBuilder Append(string value)
{
_builder.Append(value);

if (_includeTemplate)
{
_templateBuilder.Append(value);
}

return this;
}

public QBuilder Append(char value)
{
_builder.Append(value);

if (_includeTemplate)
{
_templateBuilder.Append(value);
}

return this;
}

Expand Down

0 comments on commit 0692da0

Please sign in to comment.