private object BuildModel(NameValueCollection queryString) { var stamp = queryString["stamp"]; var model = new VersionCheckDetails(); var items = new List<VersionCheckDetailsItem>(); if (queryString.AllKeys.Length > 0) { foreach (var token in queryString.AllKeys) { if (!_reservedKeys.ContainsKey(token)) { var item = new VersionCheckDetailsItem { Name = token }; ParseVersion(item, queryString[token]); items.Add(item); } } } model.Packages = items; model.Stamp = stamp; return model; }
private void ParseVersion(VersionCheckDetailsItem item, string version) { item.Version = version; item.VersionRange = version; if (!string.IsNullOrEmpty(version) && version.Contains("..")) { var split = version.Split(new[] { ".." }, StringSplitOptions.None); if (split.Length >= 1) item.Version = split[0]; if (split.Length >= 2) item.VersionRange = split[1]; } }
public LatestReleaseDetails GetLatestReleaseInfo(VersionCheckDetailsItem request, bool includeReleasesData = false) { return GetLatestReleaseInfo(request.Name, request.Version, includeReleasesData); }
public ExistingReleaseDetails GetReleaseInfo(VersionCheckDetailsItem request) { return GetReleaseInfo(request.Name, request.Version); }
public ReleaseQueryDetails GetReleaseInfo(VersionCheckDetailsItem request, bool includeReleasesData = false) { return GetReleaseInfo(request.Name, request.Version, request.VersionRange, includeReleasesData); }
public ReleaseQueryDetails GetReleaseInfo(VersionCheckDetailsItem request, bool includeReleasesData = false) { return(GetReleaseInfo(request.Name, request.Version, request.VersionRange, includeReleasesData)); }