|
|
|
|
using System.Collections.Immutable;
|
|
|
|
|
using Common.Security;
|
|
|
|
|
using Connected.Globalization.Languages;
|
|
|
|
|
using Connected.ServiceModel;
|
|
|
|
|
using Connected.Services;
|
|
|
|
|
using Connected.Services.Annotations;
|
|
|
|
|
|
|
|
|
|
namespace Common.Globalization;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The implementation of the <see cref="ILanguageService"/> service.
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal class LanguageService : EntityService<int>, ILanguageService
|
|
|
|
|
{
|
|
|
|
|
public LanguageService(IContext context) : base(context)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[ServiceAuthorization(CommonClaims.CommonDelete)]
|
|
|
|
|
public async Task Delete(PrimaryKeyArgs<int> args)
|
|
|
|
|
{
|
|
|
|
|
await Invoke(GetOperation<DeleteLanguage>(), args);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[ServiceAuthorization(CommonClaims.CommonAdd)]
|
|
|
|
|
public async Task<int> Insert(LanguageInsertArgs args)
|
|
|
|
|
{
|
|
|
|
|
return await Invoke(GetOperation<InsertLanguage>(), args);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[ServiceAuthorization(CommonClaims.CommonRead)]
|
|
|
|
|
public async Task<ImmutableList<ILanguage>?> Query()
|
|
|
|
|
{
|
|
|
|
|
return await Invoke(GetOperation<QueryLanguages>(), Dto.Empty);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[ServiceAuthorization(CommonClaims.CommonRead)]
|
|
|
|
|
public async Task<ImmutableList<ILanguage>?> Query(PrimaryKeyListArgs<int> args)
|
|
|
|
|
{
|
|
|
|
|
return await Invoke(GetOperation<LookupLanguages>(), args);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[ServiceAuthorization(CommonClaims.CommonRead)]
|
|
|
|
|
public async Task<ILanguage?> Resolve(LanguageResolveArgs args)
|
|
|
|
|
{
|
|
|
|
|
return await Invoke(GetOperation<ResolveLanguage>(), args);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[ServiceAuthorization(CommonClaims.CommonRead)]
|
|
|
|
|
public async Task<ILanguage?> Select(PrimaryKeyArgs<int> args)
|
|
|
|
|
{
|
|
|
|
|
return await Invoke(GetOperation<SelectLanguage>(), args);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[ServiceAuthorization(CommonClaims.CommonRead)]
|
|
|
|
|
public async Task<ILanguage?> Select(NameArgs args)
|
|
|
|
|
{
|
|
|
|
|
return await Invoke(GetOperation<SelectLanguageByName>(), args);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[ServiceAuthorization(CommonClaims.CommonModify)]
|
|
|
|
|
public async Task Update(LanguageUpdateArgs args)
|
|
|
|
|
{
|
|
|
|
|
await Invoke(GetOperation<UpdateLanguage>(), args);
|
|
|
|
|
}
|
|
|
|
|
}
|