Skip to content

Commit

Permalink
Make FieldName Properties Public (redis#353)
Browse files Browse the repository at this point in the history
Made FieldName properties public
  • Loading branch information
zhskay authored Dec 25, 2024
1 parent bcfacac commit 8246616
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/NRedisStack/Search/FieldName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@ namespace NRedisStack.Search
{
public class FieldName
{
private readonly string fieldName;
private string? alias;
public string Name { get; }
public string? Alias { get; private set; }

public FieldName(string name) : this(name, null) { }

public FieldName(string name, string? attribute)
{
this.fieldName = name;
this.alias = attribute;
this.Name = name;
this.Alias = attribute;
}

public int AddCommandArguments(List<object> args)
{
args.Add(fieldName);
if (alias == null)
args.Add(Name);
if (Alias is null)
{
return 1;
}

args.Add("AS");
args.Add(alias);
args.Add(Alias);
return 3;
}

Expand All @@ -33,7 +33,7 @@ public static FieldName Of(string name)

public FieldName As(string attribute)
{
this.alias = attribute;
this.Alias = attribute;
return this;
}
}
Expand Down

0 comments on commit 8246616

Please sign in to comment.