I have an enum like;
[Flags]
public enum MeteoType : ushort
{
Wind = 1 << 0,
Pressure = 1 << 1,
Temperature = 1 << 2,
Waves = 1 << 4,
Currents = 1 << 9,
Swell = 1 << 13,
WindWave = 1 << 14,
}
and I have a model;
public class Params
{
public List<MeteoType> Meteo { get; set; } = new List<MeteoType>()
{
MeteoType.Wind
};
....
}
In my controller method, I ask for this model from query as such;
public async Task<IActionResult> Get(int z, int x, int y, [FromQuery] Params parameters)
Which gives me this view in swagger:
I'm using List because it's a flag and I want to be able to choose multiple elements. The problem starts here. When I choose multiple elements the link is created like:
https://localhost:44311?Meteo=1&Meteo=2&Meteo=4&...
rather than
https://localhost:44311?Meteo=7&...
How can I make it so that link is generated by sum of enum values, rather than all of them one by one?
