Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrected patch ordering when looking for highest version patch (Issue… #311

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ protected override void ProcessRecord()

if (string.IsNullOrEmpty(VersionNumber))
{
var solution = (from sol in context.SolutionSet
where sol.UniqueName==ParentSolutionUniqueName || sol.UniqueName.StartsWith(ParentSolutionUniqueName + "_Patch")
var solution = (from sol in (
from sAnon in context.SolutionSet
where sAnon.UniqueName == ParentSolutionUniqueName || sAnon.UniqueName.StartsWith(ParentSolutionUniqueName + "_Patch")
select new { FriendlyName = sAnon.FriendlyName, Version = new Version(sAnon.Version) }).AsEnumerable()
orderby sol.Version descending
select new Solution { Version = sol.Version, FriendlyName = sol.FriendlyName }).FirstOrDefault();
select new Solution { Version = sol.Version.ToString(), FriendlyName = sol.FriendlyName }).FirstOrDefault();
if (solution == null || string.IsNullOrEmpty(solution.Version))
{
throw new Exception(string.Format("Parent solution with unique name {0} not found.", ParentSolutionUniqueName));
Expand Down