示例#1
0
        public override string ToString()
        {
            var q = $"({QueryString}).{FormatString}";

            var args = new List <string>();

            if (LevelOfDetail != LevelOfDetail.Undefined)
            {
                args.Add($"detail={LevelOfDetailString}");
            }

            if (Relations.Any())
            {
                args.Add($"relations={string.Join(',', Relations)}");
            }

            for (int i = 0; i < args.Count; i++)
            {
                q += i == 0 ? "?" : "&";
                q += args[i];
            }

            return(q);
        }
示例#2
0
 public QueryBuilder WithRelation(Relations relation)
 {
     _query.Relations.Add(relation);
     return(this);
 }