filipw / Strathweb.Samples.AspNetCore.QueryStringBinding

MIT License
24 stars 9 forks source link

Refactored to work with multiple CommaSeparated query parameters. #3

Closed chriscab83 closed 6 years ago

chriscab83 commented 6 years ago
  1. CommaSeparatedQueryStringConvention: a. Added single SeparatedQueryStringAttribute object to be used while looping through each parameter. b. Removed second check in if statement to allow for handling of multiple parameters with attribute. c. Utilized new "AddKey()" method of SeparatedQueryStringAttribute to add keys with attribute.
  2. SeparatedQueryStringAttribute: a. Added new method, AddKey(string), to add additional strings to the keys to be used in SeparatedQueryStringValueProviderFactory
  3. SeparatedQueryStringValueProviderFactory: a. Changed string _key to HashSet _keys to hold list of keys to be checked rather than single key. b. Added new constructor to take IEnumerable to initialize the _keys variable. c. Refactored current constructor(string, string) to use newly created constructor. d. Refactored CreateValueProviderAsync(ValueProviderFactorContext) method to use newly created constructor in SeparatedQueryStringValueProvider which handles IEnumerable of keys. e. Added AddKey(string) method to add new keys to _keys HashSet.
  4. SeparatedQueryStringValueProvider: a. Changed string _key to HashSet _keys to hold list of keys to be checked rather than single key. b. Added new constructor to take IEnumerable to initialize the _keys variable. c. Refactored constructor(string, IQueryCollection, string) to use new constructor to intialize _keys. d. Refactored GetValue(string) to check if HashSet contains key being checked rather than testing against single _key.
nattster commented 6 years ago

👍 this works great. Thank you!

filipw commented 6 years ago

Perfect! sorry for the delay ☺️