diff --git a/api/modules/Kurs.Languages/Kurs.Languages.Application.Contracts/ILanguageTextAppService.cs b/api/modules/Kurs.Languages/Kurs.Languages.Application.Contracts/ILanguageTextAppService.cs index c06cfaf7..7f3dc409 100644 --- a/api/modules/Kurs.Languages/Kurs.Languages.Application.Contracts/ILanguageTextAppService.cs +++ b/api/modules/Kurs.Languages/Kurs.Languages.Application.Contracts/ILanguageTextAppService.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; @@ -14,4 +15,5 @@ public interface ILanguageTextAppService : ICrudAppService< Task> GetLanguageTextTranslatedAsync(LanguageTextTranslatedRequestDto input); Task GetLanguageTextAsync(LanguageTextFilteredDto input); Task UpdateLanguageTextAsync(LanguageTextCreateUpdateDto input); + Task> GetLanguageTextByCultureNameAsync(string CultureName); } diff --git a/api/modules/Kurs.Languages/Kurs.Languages.Application/LanguageTextAppService.cs b/api/modules/Kurs.Languages/Kurs.Languages.Application/LanguageTextAppService.cs index c92a4b50..00af2d73 100644 --- a/api/modules/Kurs.Languages/Kurs.Languages.Application/LanguageTextAppService.cs +++ b/api/modules/Kurs.Languages/Kurs.Languages.Application/LanguageTextAppService.cs @@ -11,6 +11,7 @@ using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.Auditing; +using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories; using Volo.Abp.Validation; @@ -113,6 +114,17 @@ public class LanguageTextAppService : CrudAppService< return ObjectMapper.Map(entity); } + public async Task> GetLanguageTextByCultureNameAsync(string CultureName) + { + var item = await _repositoryText.GetListAsync(a => a.CultureName == CultureName); + if (item is null) + { + throw new EntityNotFoundException(L["RecordNotFound"]); + } + + return ObjectMapper.Map, List>(item); + } + protected virtual IQueryable ApplySorting(IQueryable query, LanguageTextTranslatedRequestDto input) { //Try to sort query if available