Skip to content

Commit

Permalink
DocumentFilterProperties asc property renaming. (#23409)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZulaMostafa authored Aug 19, 2021
1 parent 878e25f commit 8616071
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace Azure.AI.Translation.Document
{
public partial class DocumentFilterOrder
{
public DocumentFilterOrder(Azure.AI.Translation.Document.DocumentFilterProperty property, bool asc = true) { }
public DocumentFilterOrder(Azure.AI.Translation.Document.DocumentFilterProperty property, bool ascending = true) { }
public Azure.AI.Translation.Document.DocumentFilterProperty Property { get { throw null; } set { } }
}
public enum DocumentFilterProperty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ public class DocumentFilterOrder
/// <summary>
/// Initializes an instance of <see cref="DocumentFilterOrder"/>.
/// </summary>
public DocumentFilterOrder(DocumentFilterProperty property, bool asc = true)
public DocumentFilterOrder(DocumentFilterProperty property, bool ascending = true)
{
Property = property;
Asc = asc;
Ascending = ascending;
}
/// <summary>
/// Sort results ascendingly if true, or descendingly if false.
/// </summary>
internal bool Asc { get; set; }
internal bool Ascending { get; set; }
/// <summary>
/// See <see cref="DocumentFilterProperty"/> for list of properties supported.
/// </summary>
Expand All @@ -47,7 +47,7 @@ internal string ToGenerated()
}

// sorting direction
var direction = Asc ? "Asc" : "Desc";
var direction = Ascending ? "Asc" : "Desc";

return $"{property} {direction}";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public async Task GetDocumentStatusesOrderByCreatedOn()
// list docs
var options = new GetDocumentStatusesOptions
{
OrderBy = { new DocumentFilterOrder(property: DocumentFilterProperty.CreatedOn, asc: false) }
OrderBy = { new DocumentFilterOrder(property: DocumentFilterProperty.CreatedOn, ascending: false) }
};

var filterResults = operation.GetDocumentStatuses(options: options);
Expand Down

0 comments on commit 8616071

Please sign in to comment.