Ejemplo n.º 1
0
        private IEnumerable <SoftString> GetComponents(SoftString scheme)
        {
            if (scheme)
            {
                yield return($"{scheme.ToString()}:");
            }

            if (Authority)
            {
                yield return($"//{Authority.ToString()}{(Path.Original ? "/" : string.Empty)}");
            }

            yield return(Path.Original);

            if (Query.Any())
            {
                var queryPairs =
                    Query
                    .OrderBy(x => x.Key)
                    .Select(x => $"{x.Key.ToString()}{(x.Value ? "=" : string.Empty)}{x.Value.ToString()}");
                yield return($"?{string.Join("&", queryPairs)}");
            }

            if (Fragment)
            {
                yield return($"#{Fragment.ToString()}");
            }
        }
Ejemplo n.º 2
0
 private NLog.ILogger GetLogger(SoftString name)
 {
     return(_cache.GetOrAdd(name, n => NLog.LogManager.GetLogger(name.ToString())));
 }