Represents a repository for doing CRUD operations for
Inheritance
System.Object
Assembly: cs.temp.dll.dll
public class MediaRepository : ContentRepositoryBase<int, IMedia, MediaRepository>
Constructors
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
| Type |
Name |
Description |
| 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 |
|
Properties
Declaration
protected override Guid NodeObjectTypeId { get; }
Property Value
| Type |
Description |
| System.Guid |
|
Declaration
public override int RecycleBinId { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
Declaration
protected override MediaRepository This { get; }
Property Value
Methods
Declaration
public bool Exists(Guid id)
Parameters
| Type |
Name |
Description |
| System.Guid |
id |
|
Returns
| Type |
Description |
| System.Boolean |
|
Declaration
public IMedia Get(Guid id)
Parameters
| Type |
Name |
Description |
| System.Guid |
id |
|
Returns
Declaration
public override IEnumerable<IMedia> GetAllVersions(int nodeId)
Parameters
| Type |
Name |
Description |
| System.Int32 |
nodeId |
|
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerable<IMedia> |
|
Declaration
protected override Sql<ISqlContext> GetBaseQuery(bool isCount)
Parameters
| Type |
Name |
Description |
| System.Boolean |
isCount |
|
Returns
Declaration
protected override Sql<ISqlContext> GetBaseQuery(QueryType queryType)
Parameters
Returns
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
Declaration
protected override string GetBaseWhereClause()
Returns
| Type |
Description |
| System.String |
|
Declaration
protected override IEnumerable<string> GetDeleteClauses()
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerable<System.String> |
|
Declaration
public IMedia GetMediaByPath(string mediaPath)
Parameters
| Type |
Name |
Description |
| System.String |
mediaPath |
|
Returns
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
| Type |
Name |
Description |
| IQuery<IMedia> |
query |
|
| System.Int64 |
pageIndex |
|
| System.Int32 |
pageSize |
|
| System.Int64 |
totalRecords |
|
| IQuery<IMedia> |
filter |
|
| Ordering |
ordering |
|
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerable<IMedia> |
|
Declaration
public override IMedia GetVersion(int versionId)
Parameters
| Type |
Name |
Description |
| System.Int32 |
versionId |
|
Returns
Declaration
protected override void PerformDeleteVersion(int id, int versionId)
Parameters
| Type |
Name |
Description |
| System.Int32 |
id |
|
| System.Int32 |
versionId |
|
Declaration
protected override IMedia PerformGet(int id)
Parameters
| Type |
Name |
Description |
| System.Int32 |
id |
|
Returns
Declaration
protected override IEnumerable<IMedia> PerformGetAll(params int[] ids)
Parameters
| Type |
Name |
Description |
| System.Int32[] |
ids |
|
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerable<IMedia> |
|
Declaration
protected override IEnumerable<IMedia> PerformGetByQuery(IQuery<IMedia> query)
Parameters
| Type |
Name |
Description |
| IQuery<IMedia> |
query |
|
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerable<IMedia> |
|
Declaration
protected override void PersistDeletedItem(IMedia entity)
Parameters
| Type |
Name |
Description |
| IMedia |
entity |
|
Declaration
protected override void PersistNewItem(IMedia entity)
Parameters
| Type |
Name |
Description |
| IMedia |
entity |
|
Declaration
protected override void PersistUpdatedItem(IMedia entity)
Parameters
| Type |
Name |
Description |
| IMedia |
entity |
|
Declaration
public bool RecycleBinSmells()
Returns
| Type |
Description |
| System.Boolean |
|