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

proper filter for webapp and function app #993

Merged
merged 3 commits into from
Mar 5, 2020

Conversation

weidongxu-microsoft
Copy link
Member

@weidongxu-microsoft weidongxu-microsoft commented Mar 3, 2020

from sev3 ICM

fix #992

@@ -58,7 +56,12 @@ public override async Task<IPagedCollection<IFunctionApp>> ListAsync(bool loadAl
Inner.ListNextAsync,
async (inner, cancellation) => await PopulateModelAsync(inner, cancellation),
loadAllPages, cancellationToken);
return PagedCollection<IFunctionApp, SiteInner>.CreateFromEnumerable(collection.Where(w => "functionapp".Equals(w.Inner.Kind, StringComparison.OrdinalIgnoreCase)));
return PagedCollection<IFunctionApp, SiteInner>.CreateFromEnumerable(collection.Where(w => w.Inner.Kind != null && w.Inner.Kind.Split(new char[] { ',' }).Contains("functionapp")));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems duplicate

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why we remove StringComparison.OrdinalIgnoreCase here

Copy link
Member Author

@weidongxu-microsoft weidongxu-microsoft Mar 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for point this out. I should use FilterFunctionApp uniformly.

For ignoreCase, I will add ToLower before Split as protection, though it should not happen in live.

@weidongxu-microsoft weidongxu-microsoft merged commit 25c8d87 into master Mar 5, 2020
@weidongxu-microsoft weidongxu-microsoft deleted the fix_functionapp_list branch March 5, 2020 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Azure.AppServices.FunctionApps.ListAsync() doesn't work as expected C# SDK v1.31
3 participants