From af9b15de019b3627fe7f9c20baa2eaac88c8c413 Mon Sep 17 00:00:00 2001 From: Jorrit Schippers Date: Mon, 16 Jul 2018 14:33:25 +0200 Subject: [PATCH] Prevent ambiguity when referencing Link.BuildUrl() without parameters --- Source/Glass.Mapper.Sc/Fields/Link.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/Glass.Mapper.Sc/Fields/Link.cs b/Source/Glass.Mapper.Sc/Fields/Link.cs index b2caf19cd..ab9b6608c 100644 --- a/Source/Glass.Mapper.Sc/Fields/Link.cs +++ b/Source/Glass.Mapper.Sc/Fields/Link.cs @@ -80,9 +80,12 @@ public class Link public const string UrlFormat = "{0}{1}"; + public string BuildUrl() + { + return BuildUrl((SafeDictionary)null); + } - - [Obsolete("User the SafeDictionary alternative")] + [Obsolete("Use the SafeDictionary alternative")] public string BuildUrl(NameValueCollection attributes = null) { return BuildUrl(attributes.ToSafeDictionary()); @@ -114,7 +117,7 @@ public string BuildUrl(SafeDictionary attributes = null) var query = getValue("query", () => Query); var anchor = getValue("anchor", () => Anchor); - if (query.IsNotNullOrEmpty()) + if (query.HasValue()) builder.AddToQueryString(query); return UrlFormat.Formatted(builder.ToString(), anchor.IsNullOrEmpty() ? "" : "#" + anchor);