- Prioritätsbehandlung für document_path_dmz in EnvelopeService.LoadEnvelopes hinzugefügt. - CRUD-Operationen in EnvlopeDocument und ConfigurationFile Services/Repositories unter Verwendung von WebCoreModules implementiert. - Verschiedene Dateimethoden in [spezifischen Orten oder Klassen, falls zutreffend] auf async umgestellt.
30 lines
1.1 KiB
C#
30 lines
1.1 KiB
C#
using AutoMapper;
|
|
using DigitalData.Core.Application;
|
|
using DigitalData.Core.Contracts.Application;
|
|
using DigitalData.Core.Contracts.CultureServices;
|
|
using EnvelopeGenerator.Application.Contracts;
|
|
using EnvelopeGenerator.Application.DTOs;
|
|
using EnvelopeGenerator.Domain.Entities;
|
|
using EnvelopeGenerator.Infrastructure.Contracts;
|
|
|
|
namespace EnvelopeGenerator.Application.Services
|
|
{
|
|
public class ConfigService : BasicCRUDService<IConfigRepository, ConfigDto, Config, int>, IConfigService
|
|
{
|
|
public ConfigService(IConfigRepository repository, IKeyTranslationService translationService, IMapper mapper) : base(repository, translationService, mapper)
|
|
{
|
|
}
|
|
|
|
public async Task<IServiceResult<ConfigDto>> ReadFirstAsync()
|
|
{
|
|
var config = await _repository.ReadFirstAsync();
|
|
|
|
if (config is null)
|
|
return Failed<ConfigDto>("There is no configuration in DB.");
|
|
|
|
return Successful(_mapper.MapOrThrow<ConfigDto>(config));
|
|
}
|
|
|
|
public async Task<IServiceResult<ConfigDto>> ReadDefaultAsync() => await ReadFirstAsync();
|
|
}
|
|
} |