Introduced `JobExceptionHandlingBehavior` to handle exceptions, log errors, and rethrow them during MediatR pipeline execution. Updated `DependencyInjection.cs` to register the new behavior and added a `recClientApiUrl` parameter for API configuration. Enhanced `ProfileMappingProfile.cs` and `GetProfileQuery.cs` with XML documentation for better readability. Improved case-insensitive filtering in `GetProfileQuery` with conditional compilation for .NET version compatibility. Modified `CreateProfileHistoryCommand.cs` to use a non-nullable `AddedWho` property. Added missing `using` directive in `GetProfileQuery.cs` for compatibility. These changes improve code quality, maintainability, and functionality.
27 lines
924 B
C#
27 lines
924 B
C#
using AutoMapper;
|
|
using ECMJobRunner.Application.Common.Dtos;
|
|
using ECMJobRunner.Domain.Entities;
|
|
|
|
namespace ECMJobRunner.Application.Common.Mapping
|
|
{
|
|
/// <summary>
|
|
/// AutoMapper profile for CfgProfile and ProfileSqlJob mappings
|
|
/// Maps domain entities to DTOs
|
|
/// </summary>
|
|
public class ProfileMappingProfile : Profile
|
|
{
|
|
/// <summary>
|
|
/// Configures AutoMapper mappings for <see cref="ECMJobRunner.Domain.Entities.CfgProfile"/> and <see cref="ECMJobRunner.Domain.Entities.ProfileSqlJob"/> entities
|
|
/// </summary>
|
|
public ProfileMappingProfile()
|
|
{
|
|
// CfgProfile -> CfgProfileDto
|
|
CreateMap<CfgProfile, CfgProfileDto>()
|
|
.ForMember(dest => dest.SqlJobs, opt => opt.MapFrom(src => src.SqlJobs));
|
|
|
|
// ProfileSqlJob -> ProfileSqlJobDto
|
|
CreateMap<ProfileSqlJob, ProfileSqlJobDto>();
|
|
}
|
|
}
|
|
}
|