private IEnumerable <PackageDto> GetPackageDto(PackageKey key) { if (string.IsNullOrEmpty(key.Version)) { return(_nugetLibraryProxy.GetById(key.Id)); } var package = _nugetLibraryProxy.GetByKey(key); if (package == null) { return(new PackageDto[0]); } return(new[] { package }); }
public MainWindowModel(INugetLibraryProxy nugetLibraryProxy, IEnumerable <PackageKey> packageKeys) { PackageKeys = packageKeys.Select(x => new PackageControlModel(x, nugetLibraryProxy.GetById(x.Id).Select(y => y.Key))) .ToList(); }