Permalink
Browse files

added 'No dependencies' message when a dependency set has no deps

  • Loading branch information...
1 parent 5048bc7 commit 1f001c94e056cf5c6ff210364dafc0aee335a1f3 @half-ogre half-ogre committed Jun 15, 2012
@@ -10,7 +10,7 @@ public class DependencySetsViewModel
public DependencySetsViewModel(IEnumerable<PackageDependency> packageDependencies)
{
DependencySets = new Dictionary<string, IEnumerable<DependencyViewModel>>();
-
+
var dependencySets = packageDependencies
.GroupBy(d => d.TargetFramework)
.OrderBy(ds => ds.Key);
@@ -20,7 +20,7 @@ public DependencySetsViewModel(IEnumerable<PackageDependency> packageDependencie
foreach(var dependencySet in dependencySets)
{
var targetFramework = dependencySet.Key == null ? "All Frameworks" : VersionUtility.ParseFrameworkName(dependencySet.Key).ToFriendlyName();
- DependencySets.Add(targetFramework, dependencySet.Select(d => new DependencyViewModel(d.Id, d.VersionSpec)));
+ DependencySets.Add(targetFramework, dependencySet.Select(d => d.Id == null ? null : new DependencyViewModel(d.Id, d.VersionSpec)));
}
}
@@ -14,8 +14,15 @@
@foreach (var dependency in dependencySet.Value)
{
<li>
+ @if (dependency == null)
+ {
+ @:No dependencies.
+ }
+ else
+ {
<a href="@Url.Package(dependency.Id)">@dependency.Id</a>
<span>@dependency.VersionSpec</span>
+ }
</li>
}
</ul>

0 comments on commit 1f001c9

Please sign in to comment.