Skip to main content
Namespace: Numa.Services
Related Models: SermonCollection.cs
Related Interfaces: ISermonCollectionService.cs

Fields

Field NameTypeDescription
_dbContextFactoryIDbContextFactory<NumaContext>DbContextFactory for instantiating instances of NumaContext on-demand

Constructor

public SermonCollectionService( IDbContextFactory<NumaContext> dbContextFactory )
{
    _dbContextFactory = dbContextFactory ?? throw new ArgumentNullException( nameof( dbContextFactory ) );
}

Properties

SermonCollectionService does not have any properties.

Methods

Method NameDescriptionParametersReturn Type
GetSermonCollectionsByUserIdAsyncGets all sermon collections available to the current userstringTask<IEnumerable<SermonCollection>>
GetSermonCollectionsByUploadPermissionsAsyncGets all sermon collections that can have new sermons uploadedTask<IEnumerable<SermonCollection>>
GetAllPublicSermonCollectionsAsyncGets all public sermon collections that are not deletedTask<IEnumerable<SermonCollection>>
GetImageSrcByIdAsyncGets the ImageSrc of a sermon collection; returns the relative path of the thumbnail image, if it has onestringTask<string?>
GetNameByIdAsyncGets the Name of a sermon collectionstringTask<string>
GetIndexIdentifierByIdAsyncGets the IndexIdentifier of a sermon collectionstringTask<string>

ISermonCollectionService.cs

using Numa.Models;

namespace Numa.Interfaces
{
    public interface ISermonCollectionService
    {
        Task<IEnumerable<SermonCollection>> GetSermonCollectionsByUserIdAsync( string userId );
        Task<IEnumerable<SermonCollection>> GetSermonCollectionsByUploadPermissionsAsync();
        Task<string?> GetImageSrcByIdAsync( string sermonCollectionId );
        Task<string> GetNameByIdAsync( string sermonCollectionId );
        Task<IEnumerable<SermonCollection>> GetAllPublicSermonCollectionsAsync();
        Task<string> GetIndexIdentifierByIdAsync( string sermonCollectionId );
    }
}