View Source
Class PackagesRepository
Manages the storage of installed/created package definitions
Assembly: Umbraco.Core.dll
Syntax
[Obsolete("Packages have now been moved to the database instead of local files, please use CreatedPackageSchemaRepository instead")]
public class PackagesRepository : ICreatedPackagesRepository, IPackageDefinitionRepository
Constructors
View Source
PackagesRepository(IContentService, IContentTypeService, IDataTypeService, IFileService, ILocalizationService, IHostingEnvironment, IEntityXmlSerializer, IOptions<GlobalSettings>, IMediaService, IMediaTypeService, MediaFileManager, FileSystems, string, string?, string?, string?)
Declaration
public PackagesRepository(IContentService contentService, IContentTypeService contentTypeService, IDataTypeService dataTypeService, IFileService fileService, ILocalizationService languageService, IHostingEnvironment hostingEnvironment, IEntityXmlSerializer serializer, IOptions<GlobalSettings> globalSettings, IMediaService mediaService, IMediaTypeService mediaTypeService, MediaFileManager mediaFileManager, FileSystems fileSystems, string packageRepositoryFileName, string? tempFolderPath = null, string? packagesFolderPath = null, string? mediaFolderPath = null)
Parameters
Methods
View Source
Delete(int)
Declaration
public void Delete(int id)
Parameters
| Type |
Name |
Description |
| int |
id |
|
View Source
DeleteLocalRepositoryFiles()
Declaration
public void DeleteLocalRepositoryFiles()
View Source
ExportPackage(PackageDefinition)
Creates the package file and returns it's physical path
Declaration
public string ExportPackage(PackageDefinition definition)
Parameters
Returns
View Source
GetAll()
Declaration
public IEnumerable<PackageDefinition?> GetAll()
Returns
View Source
GetById(int)
Declaration
public PackageDefinition? GetById(int id)
Parameters
| Type |
Name |
Description |
| int |
id |
|
Returns
View Source
GetByKey(Guid)
Declaration
public PackageDefinition? GetByKey(Guid key)
Parameters
| Type |
Name |
Description |
| Guid |
key |
|
Returns
View Source
SavePackage(PackageDefinition)
Persists a package definition to storage
Declaration
public bool SavePackage(PackageDefinition definition)
Parameters
Returns
| Type |
Description |
| bool |
true if creating/updating the package was successful, otherwise false
|