View Source
Represents a repository for doing CRUD operations for IMedia
Inheritance
System.Object
Assembly: Umbraco.Infrastructure.dll
public class MediaRepository : ContentRepositoryBase<int, IMedia, MediaRepository>, IMediaRepository, IContentRepository<int, IMedia>, IReadWriteQueryRepository<int, IMedia>, IReadRepository<int, IMedia>, IWriteRepository<IMedia>, IQueryRepository<IMedia>, IReadRepository<Guid, IMedia>, IRepository
Constructors
View Source
Declaration
public MediaRepository(IScopeAccessor scopeAccessor, AppCaches cache, ILogger<MediaRepository> logger, ILoggerFactory loggerFactory, IMediaTypeRepository mediaTypeRepository, ITagRepository tagRepository, ILanguageRepository languageRepository, IRelationRepository relationRepository, IRelationTypeRepository relationTypeRepository, PropertyEditorCollection propertyEditorCollection, MediaUrlGeneratorCollection mediaUrlGenerators, DataValueReferenceFactoryCollection dataValueReferenceFactories, IDataTypeService dataTypeService, IJsonSerializer serializer, IEventAggregator eventAggregator)
Parameters
Properties
View Source
Declaration
protected override Guid NodeObjectTypeId { get; }
Property Value
View Source
Declaration
public override int RecycleBinId { get; }
Property Value
Type |
Description |
System.Int32 |
|
View Source
Declaration
protected override MediaRepository This { get; }
Property Value
Methods
View Source
Declaration
public bool Exists(Guid id)
Parameters
Type |
Name |
Description |
Guid |
id |
|
Returns
Type |
Description |
System.Boolean |
|
View Source
Declaration
public IMedia Get(Guid id)
Parameters
Type |
Name |
Description |
Guid |
id |
|
Returns
View Source
Declaration
public override IEnumerable<IMedia> GetAllVersions(int nodeId)
Parameters
Type |
Name |
Description |
System.Int32 |
nodeId |
|
Returns
Type |
Description |
IEnumerable<IMedia> |
|
View Source
Declaration
protected override Sql<ISqlContext> GetBaseQuery(bool isCount)
Parameters
Type |
Name |
Description |
System.Boolean |
isCount |
|
Returns
View Source
Declaration
protected override Sql<ISqlContext> GetBaseQuery(QueryType queryType)
Parameters
Returns
View Source
Declaration
protected virtual Sql<ISqlContext> GetBaseQuery(QueryType queryType, bool current = true, bool joinMediaVersion = false)
Parameters
Type |
Name |
Description |
QueryType |
queryType |
|
System.Boolean |
current |
|
System.Boolean |
joinMediaVersion |
|
Returns
View Source
Declaration
protected override string GetBaseWhereClause()
Returns
Type |
Description |
System.String |
|
View Source
Declaration
protected override IEnumerable<string> GetDeleteClauses()
Returns
Type |
Description |
IEnumerable<System.String> |
|
View Source
Declaration
public IMedia GetMediaByPath(string mediaPath)
Parameters
Type |
Name |
Description |
System.String |
mediaPath |
|
Returns
View Source
GetPage(IQuery<IMedia>, Int64, Int32, out Int64, IQuery<IMedia>, Ordering)
Declaration
public override IEnumerable<IMedia> GetPage(IQuery<IMedia> query, long pageIndex, int pageSize, out long totalRecords, IQuery<IMedia> filter, Ordering ordering)
Parameters
Returns
Type |
Description |
IEnumerable<IMedia> |
|
View Source
Declaration
public override IMedia GetVersion(int versionId)
Parameters
Type |
Name |
Description |
System.Int32 |
versionId |
|
Returns
View Source
Declaration
protected override void PerformDeleteVersion(int id, int versionId)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
System.Int32 |
versionId |
|
View Source
Declaration
protected override IMedia PerformGet(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
View Source
Declaration
protected override IEnumerable<IMedia> PerformGetAll(params int[] ids)
Parameters
Type |
Name |
Description |
System.Int32[] |
ids |
|
Returns
Type |
Description |
IEnumerable<IMedia> |
|
View Source
Declaration
protected override IEnumerable<IMedia> PerformGetByQuery(IQuery<IMedia> query)
Parameters
Returns
Type |
Description |
IEnumerable<IMedia> |
|
View Source
Declaration
protected override void PersistDeletedItem(IMedia entity)
Parameters
Type |
Name |
Description |
IMedia |
entity |
|
View Source
Declaration
protected override void PersistNewItem(IMedia entity)
Parameters
Type |
Name |
Description |
IMedia |
entity |
|
View Source
Declaration
protected override void PersistUpdatedItem(IMedia entity)
Parameters
Type |
Name |
Description |
IMedia |
entity |
|
View Source
Declaration
public bool RecycleBinSmells()
Returns
Type |
Description |
System.Boolean |
|