0

I have the following method:

 public async Task<IHttpActionResult> GetGlobalPageTemplatesbyTags(List<string> tags)
        {
            var telemetry = new TelemetryClient();
            var tagLookups = new HashSet<string>(tags);
            try
            {
                var globalPageTemplateStore = CosmosStoreHolder.Instance.CosmosStoreGlobalPageTemplate;

                var globalPageTemplates = await globalPageTemplateStore.Query()
                        .Where(template => template
                            .Tags
                            .Any(tag => tagLookups.Contains(tag.TagName))

And in swagger it appears like this:

api

However when I enable remote debugging, the tags parameter is always null,

what am I missing here?

0

1 Answer 1

3

Change your controller signature to: (Add the FromUri attribute)

public async Task<IHttpActionResult> GetGlobalPageTemplatesbyTags([FromUri]List<string> tags)

And add each value in a new line like this

"short"
"long"
Sign up to request clarification or add additional context in comments.

2 Comments

doesnt seem to work either screencast.com/t/F4Gpxb9TZv
You dont need to add quotes around the words. In Swagger, you can simply write each string you want in the array in new line

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.