Beispiel #1
0
        public string ToQueryString()
        {
            var queryParts = new List <string>();

            AddIfNotNull(Books.ToQueryString(BooksQueryKey));
            AddIfNotNull(Parts.ToQueryString(PartsQueryKey));
            AddIfNotNull(Footwork.ToQueryString(FootworkQueryKey));
            AddIfNotNull(Targets.ToQueryString(TargetsQueryKey));
            AddIfNotNull(Measure.ToQueryString(MeasureQueryKey));
            AddIfNotNull(Techniques.ToQueryString(TechniquesQueryKey));
            AddIfNotNull(Weapons.ToQueryString(WeaponsQueryKey));
            AddIfNotNull(Guards.ToQueryString(GuardsQueryKey));
            AddIfNotNull(StartingGuards.ToQueryString(StartingGuardsQueryKey));

            return(string.Join("&", queryParts));

            void AddIfNotNull(string?value)
            {
                if (value != null)
                {
                    queryParts.Add(value);
                }
            }
        }