using System.Collections.Generic; using Microsoft.AspNetCore.Mvc; using System.ComponentModel.DataAnnotations; using System.ComponentModel; namespace Basic.Controllers { [Produces("application/json")] public class FromQueryParamsController { [HttpGet("addresses/validate")] public IActionResult ValidateAddress([FromQuery]Address address) { return new NoContentResult(); } [HttpGet("zip-codes/validate")] public IActionResult ValidateZipCodes([FromQuery]IEnumerable zipCodes) { return new NoContentResult(); } } public class Address { /// /// 3-letter ISO country code /// [Required] public string Country { get; set; } /// /// Name of city /// [DefaultValue("Seattle")] public string City { get; set; } } }