From 5f5180d937b7c71a366c15d0d0990867b1e1870e Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Fri, 20 Sep 2024 09:39:14 +0200 Subject: [PATCH] chore(application): Core-Bibliotheken und UserManager.Infrastructure auf 2.0.0.0 aktualisiert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Core-Bibliotheken und `UserManager.Infrastructure` in der Application-Schicht auf Version 2.0.0.0 erhöht. - DbSet-Eigenschaften aus dem DbContext injiziert. --- .../Contracts/IConfigService.cs | 2 +- .../Contracts/IEnvelopeHistoryService.cs | 1 - .../Contracts/IEnvelopeReceiverService.cs | 2 +- .../Contracts/IUserReceiverService.cs | 1 - .../DTOs/DocumentReceiverElementDto.cs | 6 ++++-- .../DTOs/DocumentStatusDto.cs | 6 ++++-- .../DTOs/EmailTemplateDto.cs | 6 ++++-- .../DTOs/EnvelopeCertificateDto.cs | 6 ++++-- .../DTOs/EnvelopeDocumentDto.cs | 6 ++++-- EnvelopeGenerator.Application/DTOs/EnvelopeDto.cs | 5 +++-- .../DTOs/EnvelopeHistory/EnvelopeHistoryDto.cs | 5 +++-- .../EnvelopeReceiver/EnvelopeReceiverBasicDto.cs | 7 +++++-- .../DTOs/EnvelopeTypeDto.cs | 6 ++++-- .../DTOs/Receiver/ReceiverUpdateDto.cs | 6 ++++-- .../DTOs/UserReceiverDto.cs | 6 ++++-- .../EnvelopeGenerator.Application.csproj | 12 ++++++------ .../Services/ConfigService.cs | 6 ++---- .../Services/DocumentReceiverElementService.cs | 2 -- .../Services/DocumentStatusService.cs | 2 -- .../Services/EmailTemplateService.cs | 4 +--- .../Services/EnvelopeHistoryService.cs | 6 ++---- .../Services/EnvelopeReceiverService.cs | 12 ++++++------ .../Services/EnvelopeService.cs | 6 +++--- .../Services/EnvelopeTypeService.cs | 1 - .../Services/ReceiverService.cs | 6 ++---- .../Services/UserReceiverService.cs | 4 +--- .../DocumentReceiverElementRepository.cs | 1 - .../Repositories/EmailTemplateRepository.cs | 1 - .../Repositories/EnvelopeCertificateRepository.cs | 1 - .../Repositories/EnvelopeHistoryRepository.cs | 1 - .../Repositories/EnvelopeTypeRepository.cs | 1 - 31 files changed, 68 insertions(+), 69 deletions(-) diff --git a/EnvelopeGenerator.Application/Contracts/IConfigService.cs b/EnvelopeGenerator.Application/Contracts/IConfigService.cs index d53f0bdd..80702fac 100644 --- a/EnvelopeGenerator.Application/Contracts/IConfigService.cs +++ b/EnvelopeGenerator.Application/Contracts/IConfigService.cs @@ -5,7 +5,7 @@ using EnvelopeGenerator.Domain.Entities; namespace EnvelopeGenerator.Application.Contracts { - public interface IConfigService : IBasicCRUDService + public interface IConfigService : IReadService { Task> ReadFirstAsync(); diff --git a/EnvelopeGenerator.Application/Contracts/IEnvelopeHistoryService.cs b/EnvelopeGenerator.Application/Contracts/IEnvelopeHistoryService.cs index d6c5e671..b72bdec2 100644 --- a/EnvelopeGenerator.Application/Contracts/IEnvelopeHistoryService.cs +++ b/EnvelopeGenerator.Application/Contracts/IEnvelopeHistoryService.cs @@ -3,7 +3,6 @@ using DigitalData.Core.DTO; using EnvelopeGenerator.Application.DTOs.EnvelopeHistory; using EnvelopeGenerator.Application.DTOs.Receiver; using EnvelopeGenerator.Domain.Entities; -using EnvelopeGenerator.Infrastructure.Contracts; using static EnvelopeGenerator.Common.Constants; namespace EnvelopeGenerator.Application.Contracts diff --git a/EnvelopeGenerator.Application/Contracts/IEnvelopeReceiverService.cs b/EnvelopeGenerator.Application/Contracts/IEnvelopeReceiverService.cs index 285ed11d..75a897a2 100644 --- a/EnvelopeGenerator.Application/Contracts/IEnvelopeReceiverService.cs +++ b/EnvelopeGenerator.Application/Contracts/IEnvelopeReceiverService.cs @@ -6,7 +6,7 @@ using EnvelopeGenerator.Domain.Entities; namespace EnvelopeGenerator.Application.Contracts { - public interface IEnvelopeReceiverService : IBasicCRUDService + public interface IEnvelopeReceiverService : IBasicCRUDService { Task>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false); diff --git a/EnvelopeGenerator.Application/Contracts/IUserReceiverService.cs b/EnvelopeGenerator.Application/Contracts/IUserReceiverService.cs index 17ae83c8..9c6f19fa 100644 --- a/EnvelopeGenerator.Application/Contracts/IUserReceiverService.cs +++ b/EnvelopeGenerator.Application/Contracts/IUserReceiverService.cs @@ -1,7 +1,6 @@ using DigitalData.Core.Abstractions.Application; using EnvelopeGenerator.Application.DTOs; using EnvelopeGenerator.Domain.Entities; -using EnvelopeGenerator.Infrastructure.Contracts; namespace EnvelopeGenerator.Application.Contracts { diff --git a/EnvelopeGenerator.Application/DTOs/DocumentReceiverElementDto.cs b/EnvelopeGenerator.Application/DTOs/DocumentReceiverElementDto.cs index 6e109e68..aff23a33 100644 --- a/EnvelopeGenerator.Application/DTOs/DocumentReceiverElementDto.cs +++ b/EnvelopeGenerator.Application/DTOs/DocumentReceiverElementDto.cs @@ -1,4 +1,6 @@ -namespace EnvelopeGenerator.Application.DTOs +using DigitalData.Core.Abstractions; + +namespace EnvelopeGenerator.Application.DTOs { public record DocumentReceiverElementDto( int Id, @@ -18,5 +20,5 @@ DateTime? ChangedWhen, double Top, double Left - ); + ): IUnique; } \ No newline at end of file diff --git a/EnvelopeGenerator.Application/DTOs/DocumentStatusDto.cs b/EnvelopeGenerator.Application/DTOs/DocumentStatusDto.cs index 4037c064..2decac1f 100644 --- a/EnvelopeGenerator.Application/DTOs/DocumentStatusDto.cs +++ b/EnvelopeGenerator.Application/DTOs/DocumentStatusDto.cs @@ -1,4 +1,6 @@ -namespace EnvelopeGenerator.Application.DTOs +using DigitalData.Core.Abstractions; + +namespace EnvelopeGenerator.Application.DTOs { public record DocumentStatusDto( int Id, @@ -8,5 +10,5 @@ DateTime? StatusChangedWhen, string Value, DateTime AddedWhen, - DateTime? ChangedWhen); + DateTime? ChangedWhen) : IUnique; } \ No newline at end of file diff --git a/EnvelopeGenerator.Application/DTOs/EmailTemplateDto.cs b/EnvelopeGenerator.Application/DTOs/EmailTemplateDto.cs index 5ec688ab..8eaa798f 100644 --- a/EnvelopeGenerator.Application/DTOs/EmailTemplateDto.cs +++ b/EnvelopeGenerator.Application/DTOs/EmailTemplateDto.cs @@ -1,8 +1,10 @@ -namespace EnvelopeGenerator.Application.DTOs +using DigitalData.Core.Abstractions; + +namespace EnvelopeGenerator.Application.DTOs { public record EmailTemplateDto( int Id, string Name, string Body, - string Subject); + string Subject) : IUnique; } \ No newline at end of file diff --git a/EnvelopeGenerator.Application/DTOs/EnvelopeCertificateDto.cs b/EnvelopeGenerator.Application/DTOs/EnvelopeCertificateDto.cs index 44547d1e..34d38990 100644 --- a/EnvelopeGenerator.Application/DTOs/EnvelopeCertificateDto.cs +++ b/EnvelopeGenerator.Application/DTOs/EnvelopeCertificateDto.cs @@ -1,4 +1,6 @@ -namespace EnvelopeGenerator.Application.DTOs +using DigitalData.Core.Abstractions; + +namespace EnvelopeGenerator.Application.DTOs { public record EnvelopeCertificateDto( int Id, @@ -8,5 +10,5 @@ int CreatorId, string CreatorName, string CreatorEmail, - int EnvelopeStatus); + int EnvelopeStatus) : IUnique; } \ No newline at end of file diff --git a/EnvelopeGenerator.Application/DTOs/EnvelopeDocumentDto.cs b/EnvelopeGenerator.Application/DTOs/EnvelopeDocumentDto.cs index caa9c335..340b3a88 100644 --- a/EnvelopeGenerator.Application/DTOs/EnvelopeDocumentDto.cs +++ b/EnvelopeGenerator.Application/DTOs/EnvelopeDocumentDto.cs @@ -1,4 +1,6 @@ -namespace EnvelopeGenerator.Application.DTOs +using DigitalData.Core.Abstractions; + +namespace EnvelopeGenerator.Application.DTOs { public record EnvelopeDocumentDto ( @@ -6,5 +8,5 @@ int EnvelopeId, DateTime AddedWhen, IEnumerable? Elements - ); + ) : IUnique; } \ No newline at end of file diff --git a/EnvelopeGenerator.Application/DTOs/EnvelopeDto.cs b/EnvelopeGenerator.Application/DTOs/EnvelopeDto.cs index 0413453a..02db9593 100644 --- a/EnvelopeGenerator.Application/DTOs/EnvelopeDto.cs +++ b/EnvelopeGenerator.Application/DTOs/EnvelopeDto.cs @@ -1,10 +1,11 @@ -using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes; +using DigitalData.Core.Abstractions; +using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes; using DigitalData.UserManager.Application.DTOs.User; using EnvelopeGenerator.Domain.Entities; namespace EnvelopeGenerator.Application.DTOs { - public record EnvelopeDto() + public record EnvelopeDto() : IUnique { public int Id { get; set; } diff --git a/EnvelopeGenerator.Application/DTOs/EnvelopeHistory/EnvelopeHistoryDto.cs b/EnvelopeGenerator.Application/DTOs/EnvelopeHistory/EnvelopeHistoryDto.cs index 54e0b1d6..0de3f3fb 100644 --- a/EnvelopeGenerator.Application/DTOs/EnvelopeHistory/EnvelopeHistoryDto.cs +++ b/EnvelopeGenerator.Application/DTOs/EnvelopeHistory/EnvelopeHistoryDto.cs @@ -1,4 +1,5 @@ -using DigitalData.Core.DTO; +using DigitalData.Core.Abstractions; +using DigitalData.Core.DTO; using DigitalData.UserManager.Application.DTOs.User; using EnvelopeGenerator.Application.DTOs.Receiver; using static EnvelopeGenerator.Common.Constants; @@ -16,5 +17,5 @@ namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory UserCreateDto? Sender, ReceiverReadDto? Receiver, ReferenceType ReferenceType, - string? Comment = null) : BaseDTO(Id); + string? Comment = null) : BaseDTO(Id), IUnique; } \ No newline at end of file diff --git a/EnvelopeGenerator.Application/DTOs/EnvelopeReceiver/EnvelopeReceiverBasicDto.cs b/EnvelopeGenerator.Application/DTOs/EnvelopeReceiver/EnvelopeReceiverBasicDto.cs index 7590df6e..4dfdf6a8 100644 --- a/EnvelopeGenerator.Application/DTOs/EnvelopeReceiver/EnvelopeReceiverBasicDto.cs +++ b/EnvelopeGenerator.Application/DTOs/EnvelopeReceiver/EnvelopeReceiverBasicDto.cs @@ -1,9 +1,12 @@ -using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes; +using DigitalData.Core.Abstractions; +using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes; namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver { - public record EnvelopeReceiverBasicDto() + public record EnvelopeReceiverBasicDto() : IUnique<(int Envelope, int Receiver)> { + public (int Envelope, int Receiver) Id => (Envelope: EnvelopeId, Receiver: ReceiverId); + public int EnvelopeId { get; init; } public int ReceiverId { get; init; } diff --git a/EnvelopeGenerator.Application/DTOs/EnvelopeTypeDto.cs b/EnvelopeGenerator.Application/DTOs/EnvelopeTypeDto.cs index 2342784d..f7f55ac3 100644 --- a/EnvelopeGenerator.Application/DTOs/EnvelopeTypeDto.cs +++ b/EnvelopeGenerator.Application/DTOs/EnvelopeTypeDto.cs @@ -1,4 +1,6 @@ -namespace EnvelopeGenerator.Application.DTOs +using DigitalData.Core.Abstractions; + +namespace EnvelopeGenerator.Application.DTOs { public record EnvelopeTypeDto( int Id, @@ -15,5 +17,5 @@ bool? SendReminderEmails, int? FirstReminderDays, int? ReminderIntervalDays, - int? ContractType); + int? ContractType) : IUnique; } \ No newline at end of file diff --git a/EnvelopeGenerator.Application/DTOs/Receiver/ReceiverUpdateDto.cs b/EnvelopeGenerator.Application/DTOs/Receiver/ReceiverUpdateDto.cs index a6818b3a..8f765667 100644 --- a/EnvelopeGenerator.Application/DTOs/Receiver/ReceiverUpdateDto.cs +++ b/EnvelopeGenerator.Application/DTOs/Receiver/ReceiverUpdateDto.cs @@ -1,4 +1,6 @@ -namespace EnvelopeGenerator.Application.DTOs.Receiver +using DigitalData.Core.Abstractions; + +namespace EnvelopeGenerator.Application.DTOs.Receiver { - public record ReceiverUpdateDto(); + public record ReceiverUpdateDto(int Id) : IUnique; } \ No newline at end of file diff --git a/EnvelopeGenerator.Application/DTOs/UserReceiverDto.cs b/EnvelopeGenerator.Application/DTOs/UserReceiverDto.cs index 8c80ecd8..8630838a 100644 --- a/EnvelopeGenerator.Application/DTOs/UserReceiverDto.cs +++ b/EnvelopeGenerator.Application/DTOs/UserReceiverDto.cs @@ -1,4 +1,6 @@ -namespace EnvelopeGenerator.Application.DTOs +using DigitalData.Core.Abstractions; + +namespace EnvelopeGenerator.Application.DTOs { public record UserReceiverDto( int Id, @@ -7,5 +9,5 @@ string Name, string CompanyName, string JobTitle, - DateTime AddedWhen); + DateTime AddedWhen) : IUnique; } \ No newline at end of file diff --git a/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj b/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj index 2d9f8fd7..5ca8bdf4 100644 --- a/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj +++ b/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj @@ -12,13 +12,13 @@ - - - - + + + + - - + + diff --git a/EnvelopeGenerator.Application/Services/ConfigService.cs b/EnvelopeGenerator.Application/Services/ConfigService.cs index 57317fc1..1d164d4f 100644 --- a/EnvelopeGenerator.Application/Services/ConfigService.cs +++ b/EnvelopeGenerator.Application/Services/ConfigService.cs @@ -3,15 +3,13 @@ using DigitalData.Core.Application; using DigitalData.Core.DTO; using EnvelopeGenerator.Application.Contracts; using EnvelopeGenerator.Application.DTOs; -using EnvelopeGenerator.Application.Resources; using EnvelopeGenerator.Domain.Entities; using EnvelopeGenerator.Infrastructure.Contracts; using Microsoft.Extensions.Caching.Memory; -using Microsoft.Extensions.Localization; using Microsoft.Extensions.Logging; namespace EnvelopeGenerator.Application.Services { - public class ConfigService : BasicCRUDService, IConfigService + public class ConfigService : ReadService, IConfigService { private static readonly Guid DefaultConfigCacheId = Guid.NewGuid(); @@ -28,7 +26,7 @@ namespace EnvelopeGenerator.Application.Services var config = await _repository.ReadFirstAsync(); return config is null ? Result.Fail().Notice(LogLevel.Error, Flag.DataIntegrityIssue, "There is no configuration in DB.") - : Result.Success(_mapper.MapOrThrow(config)); + : Result.Success(_mapper.Map(config)); } /// diff --git a/EnvelopeGenerator.Application/Services/DocumentReceiverElementService.cs b/EnvelopeGenerator.Application/Services/DocumentReceiverElementService.cs index 0c8e0c3d..24c25a25 100644 --- a/EnvelopeGenerator.Application/Services/DocumentReceiverElementService.cs +++ b/EnvelopeGenerator.Application/Services/DocumentReceiverElementService.cs @@ -2,10 +2,8 @@ using DigitalData.Core.Application; using EnvelopeGenerator.Application.Contracts; using EnvelopeGenerator.Application.DTOs; -using EnvelopeGenerator.Application.Resources; using EnvelopeGenerator.Domain.Entities; using EnvelopeGenerator.Infrastructure.Contracts; -using Microsoft.Extensions.Localization; namespace EnvelopeGenerator.Application.Services { diff --git a/EnvelopeGenerator.Application/Services/DocumentStatusService.cs b/EnvelopeGenerator.Application/Services/DocumentStatusService.cs index 019197ff..2a47922d 100644 --- a/EnvelopeGenerator.Application/Services/DocumentStatusService.cs +++ b/EnvelopeGenerator.Application/Services/DocumentStatusService.cs @@ -2,10 +2,8 @@ using DigitalData.Core.Application; using EnvelopeGenerator.Application.Contracts; using EnvelopeGenerator.Application.DTOs; -using EnvelopeGenerator.Application.Resources; using EnvelopeGenerator.Domain.Entities; using EnvelopeGenerator.Infrastructure.Contracts; -using Microsoft.Extensions.Localization; namespace EnvelopeGenerator.Application.Services { diff --git a/EnvelopeGenerator.Application/Services/EmailTemplateService.cs b/EnvelopeGenerator.Application/Services/EmailTemplateService.cs index d31e1430..2f9947f4 100644 --- a/EnvelopeGenerator.Application/Services/EmailTemplateService.cs +++ b/EnvelopeGenerator.Application/Services/EmailTemplateService.cs @@ -1,11 +1,9 @@ using AutoMapper; using DigitalData.Core.Application; -using Microsoft.Extensions.Localization; using EnvelopeGenerator.Application.Contracts; using EnvelopeGenerator.Application.DTOs; using EnvelopeGenerator.Domain.Entities; using EnvelopeGenerator.Infrastructure.Contracts; -using EnvelopeGenerator.Application.Resources; using static EnvelopeGenerator.Common.Constants; using DigitalData.Core.DTO; using Microsoft.Extensions.Logging; @@ -26,7 +24,7 @@ namespace EnvelopeGenerator.Application.Services ? Result.Fail() .Message(Key.InnerServiceError) .Notice(LogLevel.Error, Flag.DataIntegrityIssue, $"EmailTemplateType '{type}' is not found in DB. Please, define required e-mail template.") - : Result.Success(_mapper.MapOrThrow(temp)); + : Result.Success(_mapper.Map(temp)); } } } \ No newline at end of file diff --git a/EnvelopeGenerator.Application/Services/EnvelopeHistoryService.cs b/EnvelopeGenerator.Application/Services/EnvelopeHistoryService.cs index d7a4a26a..db72280a 100644 --- a/EnvelopeGenerator.Application/Services/EnvelopeHistoryService.cs +++ b/EnvelopeGenerator.Application/Services/EnvelopeHistoryService.cs @@ -1,11 +1,9 @@ using AutoMapper; using DigitalData.Core.Application; -using Microsoft.Extensions.Localization; using EnvelopeGenerator.Application.Contracts; using EnvelopeGenerator.Domain.Entities; using EnvelopeGenerator.Infrastructure.Contracts; using static EnvelopeGenerator.Common.Constants; -using EnvelopeGenerator.Application.Resources; using DigitalData.Core.DTO; using EnvelopeGenerator.Application.DTOs.EnvelopeHistory; using EnvelopeGenerator.Application.DTOs.Receiver; @@ -14,7 +12,7 @@ namespace EnvelopeGenerator.Application.Services { public class EnvelopeHistoryService : CRUDService, IEnvelopeHistoryService { - public EnvelopeHistoryService(IEnvelopeHistoryRepository repository, IStringLocalizer localizer, IMapper mapper) + public EnvelopeHistoryService(IEnvelopeHistoryRepository repository, IMapper mapper) : base(repository, mapper) { } @@ -53,7 +51,7 @@ namespace EnvelopeGenerator.Application.Services public async Task> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, int? status = null, bool withSender = false, bool withReceiver = false) { - var histDTOs = _mapper.MapOrThrow>( + var histDTOs = _mapper.Map>( await _repository.ReadAsync( envelopeId: envelopeId, userReference: userReference, diff --git a/EnvelopeGenerator.Application/Services/EnvelopeReceiverService.cs b/EnvelopeGenerator.Application/Services/EnvelopeReceiverService.cs index f995941e..bd09cac4 100644 --- a/EnvelopeGenerator.Application/Services/EnvelopeReceiverService.cs +++ b/EnvelopeGenerator.Application/Services/EnvelopeReceiverService.cs @@ -11,7 +11,7 @@ using Microsoft.Extensions.Logging; namespace EnvelopeGenerator.Application.Services { - public class EnvelopeReceiverService : BasicCRUDService, IEnvelopeReceiverService + public class EnvelopeReceiverService : BasicCRUDService, IEnvelopeReceiverService { private readonly IStringLocalizer _localizer; @@ -24,19 +24,19 @@ namespace EnvelopeGenerator.Application.Services public async Task>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true) { var env_rcvs = await _repository.ReadBySignatureAsync(signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver); - return Result.Success(_mapper.MapOrThrow>(env_rcvs)); + return Result.Success(_mapper.Map>(env_rcvs)); } public async Task>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false) { var env_rcvs = await _repository.ReadByUuidAsync(uuid: uuid, withEnvelope: withEnvelope, withReceiver: withReceiver); - return Result.Success(_mapper.MapOrThrow>(env_rcvs)); + return Result.Success(_mapper.Map>(env_rcvs)); } public async Task>> ReadSecretByUuidAsync(string uuid, bool withEnvelope = false, bool withReceiver = true) { var env_rcvs = await _repository.ReadByUuidAsync(uuid: uuid, withEnvelope: withEnvelope, withReceiver: withReceiver); - return Result.Success(_mapper.MapOrThrow>(env_rcvs)); + return Result.Success(_mapper.Map>(env_rcvs)); } public async Task> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true) @@ -46,7 +46,7 @@ namespace EnvelopeGenerator.Application.Services return Result.Fail() .Message(Key.EnvelopeReceiverNotFound); - return Result.Success(_mapper.MapOrThrow(env_rcv)); + return Result.Success(_mapper.Map(env_rcv)); } public async Task> ReadByEnvelopeReceiverIdAsync(string envelopeReceiverId, bool withEnvelope = true, bool withReceiver = true) @@ -125,7 +125,7 @@ namespace EnvelopeGenerator.Application.Services public async Task>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, params int[] ignore_statuses) { var er_list = await _repository.ReadByUsernameAsync(username: username, min_status: min_status, max_status: max_status, ignore_statuses: ignore_statuses); - var dto_list = _mapper.MapOrThrow>(er_list); + var dto_list = _mapper.Map>(er_list); return Result.Success(dto_list); } diff --git a/EnvelopeGenerator.Application/Services/EnvelopeService.cs b/EnvelopeGenerator.Application/Services/EnvelopeService.cs index 7f76b64e..fc84d2f6 100644 --- a/EnvelopeGenerator.Application/Services/EnvelopeService.cs +++ b/EnvelopeGenerator.Application/Services/EnvelopeService.cs @@ -18,7 +18,7 @@ namespace EnvelopeGenerator.Application.Services public async Task>> ReadAllWithAsync(bool documents = false, bool history = false, bool documentReceiverElement = false) { var envelopes = await _repository.ReadAllWithAsync(documents: documents, history: history, documentReceiverElement: documentReceiverElement); - var readDto = _mapper.MapOrThrow>(envelopes); + var readDto = _mapper.Map>(envelopes); return Result.Success(readDto); } @@ -29,14 +29,14 @@ namespace EnvelopeGenerator.Application.Services if (envelope is null) return Result.Fail(); - var readDto = _mapper.MapOrThrow(envelope); + var readDto = _mapper.Map(envelope); return Result.Success(readDto); } public async Task>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[] ignore_statuses) { var users = await _repository.ReadByUserAsync(userId: userId, min_status: min_status, max_status: max_status, ignore_statuses: ignore_statuses); - var readDto = _mapper.MapOrThrow>(users); + var readDto = _mapper.Map>(users); return Result.Success(readDto); } } diff --git a/EnvelopeGenerator.Application/Services/EnvelopeTypeService.cs b/EnvelopeGenerator.Application/Services/EnvelopeTypeService.cs index 5402ba05..2bc3cc75 100644 --- a/EnvelopeGenerator.Application/Services/EnvelopeTypeService.cs +++ b/EnvelopeGenerator.Application/Services/EnvelopeTypeService.cs @@ -6,7 +6,6 @@ using EnvelopeGenerator.Domain.Entities; using EnvelopeGenerator.Infrastructure.Contracts; using Microsoft.Extensions.Caching.Memory; using DigitalData.Core.DTO; -using System.Collections.Generic; using Microsoft.Extensions.Logging; namespace EnvelopeGenerator.Application.Services diff --git a/EnvelopeGenerator.Application/Services/ReceiverService.cs b/EnvelopeGenerator.Application/Services/ReceiverService.cs index edbe3d62..422f5c0f 100644 --- a/EnvelopeGenerator.Application/Services/ReceiverService.cs +++ b/EnvelopeGenerator.Application/Services/ReceiverService.cs @@ -1,10 +1,8 @@ using AutoMapper; using DigitalData.Core.Application; -using Microsoft.Extensions.Localization; using EnvelopeGenerator.Application.Contracts; using EnvelopeGenerator.Domain.Entities; using EnvelopeGenerator.Infrastructure.Contracts; -using EnvelopeGenerator.Application.Resources; using EnvelopeGenerator.Application.DTOs.Receiver; using DigitalData.Core.DTO; @@ -12,7 +10,7 @@ namespace EnvelopeGenerator.Application.Services { public class ReceiverService : CRUDService, IReceiverService { - public ReceiverService(IReceiverRepository repository, IStringLocalizer localizer, IMapper mapper) + public ReceiverService(IReceiverRepository repository, IMapper mapper) : base(repository, mapper) { } @@ -24,7 +22,7 @@ namespace EnvelopeGenerator.Application.Services if (rcv is null) return Result.Fail(); - return Result.Success(_mapper.MapOrThrow(rcv)); + return Result.Success(_mapper.Map(rcv)); } public async Task DeleteByAsync(string? emailAddress = null, string? signature = null) diff --git a/EnvelopeGenerator.Application/Services/UserReceiverService.cs b/EnvelopeGenerator.Application/Services/UserReceiverService.cs index d241d5bf..08da1906 100644 --- a/EnvelopeGenerator.Application/Services/UserReceiverService.cs +++ b/EnvelopeGenerator.Application/Services/UserReceiverService.cs @@ -1,17 +1,15 @@ using AutoMapper; using DigitalData.Core.Application; -using Microsoft.Extensions.Localization; using EnvelopeGenerator.Application.Contracts; using EnvelopeGenerator.Application.DTOs; using EnvelopeGenerator.Domain.Entities; using EnvelopeGenerator.Infrastructure.Contracts; -using EnvelopeGenerator.Application.Resources; namespace EnvelopeGenerator.Application.Services { public class UserReceiverService : BasicCRUDService, IUserReceiverService { - public UserReceiverService(IUserReceiverRepository repository, IStringLocalizer localizer, IMapper mapper) + public UserReceiverService(IUserReceiverRepository repository, IMapper mapper) : base(repository, mapper) { } diff --git a/EnvelopeGenerator.Infrastructure/Repositories/DocumentReceiverElementRepository.cs b/EnvelopeGenerator.Infrastructure/Repositories/DocumentReceiverElementRepository.cs index 5b410f98..a57bde74 100644 --- a/EnvelopeGenerator.Infrastructure/Repositories/DocumentReceiverElementRepository.cs +++ b/EnvelopeGenerator.Infrastructure/Repositories/DocumentReceiverElementRepository.cs @@ -1,5 +1,4 @@ using DigitalData.Core.Infrastructure; -using DigitalData.UserManager.Infrastructure.Repositories; using EnvelopeGenerator.Domain.Entities; using EnvelopeGenerator.Infrastructure.Contracts; diff --git a/EnvelopeGenerator.Infrastructure/Repositories/EmailTemplateRepository.cs b/EnvelopeGenerator.Infrastructure/Repositories/EmailTemplateRepository.cs index ac257a48..47772341 100644 --- a/EnvelopeGenerator.Infrastructure/Repositories/EmailTemplateRepository.cs +++ b/EnvelopeGenerator.Infrastructure/Repositories/EmailTemplateRepository.cs @@ -1,5 +1,4 @@ using DigitalData.Core.Infrastructure; -using DigitalData.UserManager.Infrastructure.Repositories; using EnvelopeGenerator.Domain.Entities; using EnvelopeGenerator.Infrastructure.Contracts; using Microsoft.EntityFrameworkCore; diff --git a/EnvelopeGenerator.Infrastructure/Repositories/EnvelopeCertificateRepository.cs b/EnvelopeGenerator.Infrastructure/Repositories/EnvelopeCertificateRepository.cs index 0c91e5f4..6bc3c4a9 100644 --- a/EnvelopeGenerator.Infrastructure/Repositories/EnvelopeCertificateRepository.cs +++ b/EnvelopeGenerator.Infrastructure/Repositories/EnvelopeCertificateRepository.cs @@ -1,5 +1,4 @@ using DigitalData.Core.Infrastructure; -using DigitalData.UserManager.Infrastructure.Repositories; using EnvelopeGenerator.Domain.Entities; using EnvelopeGenerator.Infrastructure.Contracts; diff --git a/EnvelopeGenerator.Infrastructure/Repositories/EnvelopeHistoryRepository.cs b/EnvelopeGenerator.Infrastructure/Repositories/EnvelopeHistoryRepository.cs index 2c7a5b41..97dcfc37 100644 --- a/EnvelopeGenerator.Infrastructure/Repositories/EnvelopeHistoryRepository.cs +++ b/EnvelopeGenerator.Infrastructure/Repositories/EnvelopeHistoryRepository.cs @@ -1,5 +1,4 @@ using DigitalData.Core.Infrastructure; -using DigitalData.UserManager.Infrastructure.Repositories; using EnvelopeGenerator.Domain.Entities; using EnvelopeGenerator.Infrastructure.Contracts; using Microsoft.EntityFrameworkCore; diff --git a/EnvelopeGenerator.Infrastructure/Repositories/EnvelopeTypeRepository.cs b/EnvelopeGenerator.Infrastructure/Repositories/EnvelopeTypeRepository.cs index 57308ea4..5bc9f6c5 100644 --- a/EnvelopeGenerator.Infrastructure/Repositories/EnvelopeTypeRepository.cs +++ b/EnvelopeGenerator.Infrastructure/Repositories/EnvelopeTypeRepository.cs @@ -1,5 +1,4 @@ using DigitalData.Core.Infrastructure; -using DigitalData.UserManager.Infrastructure.Repositories; using EnvelopeGenerator.Domain.Entities; using EnvelopeGenerator.Infrastructure.Contracts;