Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DocumentFilterProperties asc property renaming. #23409

Merged
merged 2 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public DocumentFilter() { }
}
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 GetAllDocumentStatusesOrderByCreatedOn()
// list docs
var filter = new DocumentFilter
{
OrderBy = { new DocumentFilterOrder(property: DocumentFilterProperty.CreatedOn, asc: false) }
OrderBy = { new DocumentFilterOrder(property: DocumentFilterProperty.CreatedOn, ascending: false) }
};

var filterResults = operation.GetAllDocumentStatuses(filter: filter);
Expand Down