- Add AutoMapper profile for CfgProfile and ProfileSqlJob entity-to-DTO mappings - Consolidate GetProfileByIdQuery and GetAllActiveProfilesQuery into unified GetProfileQuery - Implement flexible filtering with nullable query options (Id, Active, TypeId, ProfileName) - Add IncludeSqlJobs option for optimized SQL job loading - Move CfgProfileDto to Common/Dtos for better architecture alignment - Add comprehensive unit tests for GetProfileQuery with multiple filter scenarios - Move ISQLExecutor interface from Domain to Application layer - Add GetByIdWithSqlJobsAsync and GetAllActiveWithSqlJobsAsync to repository
24 lines
708 B
C#
24 lines
708 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
|
|
{
|
|
public ProfileMappingProfile()
|
|
{
|
|
// CfgProfile -> CfgProfileDto
|
|
CreateMap<CfgProfile, CfgProfileDto>()
|
|
.ForMember(dest => dest.SqlJobs, opt => opt.MapFrom(src => src.SqlJobs));
|
|
|
|
// ProfileSqlJob -> ProfileSqlJobDto
|
|
CreateMap<ProfileSqlJob, ProfileSqlJobDto>();
|
|
}
|
|
}
|
|
}
|