public ActionResult <InstalledPackage> GetInstalledPackageByName([FromQuery] string packageName) { InstalledPackage pack = _packagingService.GetInstalledPackageByName(packageName); if (pack == null) { return(NotFound()); } return(pack); }
public override void Migrate() { // Check if the package has already been installed. var pkgs = _packagingService.GetInstalledPackageByName(Constants.Internals.ProjectName); if (pkgs?.Any() == false) { // If not, then make a package definition and save it to the "installedPackages.config". _packagingService.SaveInstalledPackage(new PackageDefinition { Name = Constants.Internals.ProjectName, Url = Constants.Package.RepositoryUrl, Author = Constants.Package.Author, AuthorUrl = Constants.Package.AuthorUrl, IconUrl = Constants.Package.IconUrl, License = Constants.Package.License, LicenseUrl = Constants.Package.LicenseUrl, UmbracoVersion = Constants.Package.MinimumSupportedUmbracoVersion, Version = ContentmentVersion.Version.ToString(), Readme = "", }); } }