ResourceRepository

Namespace: Babel.Data Assembly: Babel.Data.dll

A resource repository.

public class ResourceRepository : GenericRepository<Resource>, IResourceRepository, IGenericRepository<Resource>

Inheritance

objectGenericRepository<Resource>ResourceRepository

Implements

IResourceRepository, IGenericRepository<Resource>

Inherited Members

GenericRepository<Resource>.Get(Expression<Func<Resource, bool>>, Func<IQueryable<Resource>, IOrderedQueryable<Resource>>, string, string, int?, int?), GenericRepository<Resource>.GetAsync(Expression<Func<Resource, bool>>, Func<IQueryable<Resource>, IOrderedQueryable<Resource>>, string, string, int?, int?, CancellationToken), GenericRepository<Resource>.QueryAsync(string, string, string, string, int?, int?, CancellationToken), GenericRepository<Resource>.GetById(params object[]), GenericRepository<Resource>.GetByIdAsync(params object[]), GenericRepository<Resource>.GetByIdAsync(object[], CancellationToken), GenericRepository<Resource>.CountAsync(Expression<Func<Resource, bool>>, CancellationToken), GenericRepository<Resource>.CountAsync(string, CancellationToken), GenericRepository<Resource>.Insert(Resource), GenericRepository<Resource>.InsertAsync(Resource, CancellationToken), GenericRepository<Resource>.Update(Resource), GenericRepository<Resource>.Delete(params object[]), GenericRepository<Resource>.Delete(Resource), GenericRepository<Resource>.Save(), GenericRepository<Resource>.SaveAsync(CancellationToken), GenericRepository<Resource>.DbSet, GenericRepository<Resource>.Context, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

ResourceRepository(BabelDbContext)

Constructor.

public ResourceRepository(BabelDbContext context)

Parameters

NameDescription

The context.

Methods

AddDownloadAsync(Download)

Adds a download asynchronous.

public Task<EntityEntry<Download>> AddDownloadAsync(Download download)

Parameters

NameDescription

The download.

Returns

NameDescription

An asynchronous result that yields the add download.

Delete(IEnumerable<int>)

Deletes the given list of resources from the repository. Begins tracking the given list of resources in the Detached state such that it will be deleted in the database when SaveChanges() is called.

public void Delete(IEnumerable<int> resourceIds)

Parameters

NameDescription

The Resource key identifiers to delete.

Delete(Resource)

Deletes the given entityToDelete.

public override void Delete(Resource resource)

Parameters

NameDescription

The entity to delete to delete.

DeleteDownloads(IEnumerable<int>)

Deletes the downloads described by downloadIds.

public void DeleteDownloads(IEnumerable<int> downloadIds)

Parameters

NameDescription

List of identifiers for the downloads.

GetDownloadAsync(int)

Gets download asynchronous.

public Task<Download> GetDownloadAsync(int downloadId)

Parameters

NameDescription

Identifier for the download.

Returns

NameDescription

An asynchronous result that yields the download.

GetDownloadByAliasAsync(string)

Gets download by alias asynchronous.

public Task<Download> GetDownloadByAliasAsync(string alias)

Parameters

NameDescription

The alias.

Returns

NameDescription

An asynchronous result that yields the download by alias.

GetDownloadsAsync()

Gets downloads asynchronous.

public Task<List<Download>> GetDownloadsAsync()

Returns

NameDescription

An asynchronous result that yields the downloads.

GetResourceType(Resource)

Gets resource type.

public string GetResourceType(Resource resource)

Parameters

NameDescription

The entity to delete to delete.

Returns

NameDescription

The resource type.

GetSignatureKeysAsync(CancellationToken)

Gets signature keys asynchronous.

public Task<List<Resource>> GetSignatureKeysAsync(CancellationToken cancellationToken = default)

Parameters

NameDescription

(Optional) A token that allows processing to be cancelled.

Returns

NameDescription

An asynchronous result that yields the signature keys.

TrackResourceAsync(Resource)

Track resource asynchronous.

public Task TrackResourceAsync(Resource resource)

Parameters

NameDescription

The entity to delete to delete.

Returns

NameDescription

An asynchronous result.

UpdateDownload(Download)

Updates the download described by download.

public void UpdateDownload(Download download)

Parameters

NameDescription

The download.

Last updated