Example #1
0
        private async Task <Slug> GetSlug(string slug, CancellationToken cancellationToken = default(CancellationToken))
        {
            Check.That <ApplicationException>(Check.IsNullOrEmpty(slug), "Slug is null or empty");

            var slugEntity = await _slugRepository.GetByKey(slug);

            Check.That <DomainException>(Check.IsNull(slugEntity), "Slug is null or empty");

            return(slugEntity);
        }
Example #2
0
        public async Task <Slug> GetSlugByKeyword(string keyword, CancellationToken cancellationToken = default)
        {
            Check.ArgumentNotNullOrEmpty(keyword);

            return(await _slugRepository.GetByKey(keyword, cancellationToken));
        }