sozsoft-platform/api/modules/Sozsoft.SqlQueryManager/Sozsoft.SqlQueryManager.Application/SqlQueryManagerAutoMapperProfile.cs

89 lines
3.2 KiB
C#
Raw Normal View History

2026-02-24 20:44:16 +00:00
using AutoMapper;
using Sozsoft.SqlQueryManager.Application.Contracts;
using Sozsoft.SqlQueryManager.Domain.Entities;
using Volo.Abp.AutoMapper;
namespace Sozsoft.SqlQueryManager.Application;
public class SqlQueryManagerAutoMapperProfile : Profile
{
public SqlQueryManagerAutoMapperProfile()
{
CreateMap<SqlQuery, SqlQueryDto>();
CreateMap<CreateSqlQueryDto, SqlQuery>()
.IgnoreFullAuditedObjectProperties()
.Ignore(x => x.Id)
.Ignore(x => x.TenantId)
.Ignore(x => x.Status)
.Ignore(x => x.LastExecutedAt)
.Ignore(x => x.ExecutionCount);
CreateMap<UpdateSqlQueryDto, SqlQuery>()
.IgnoreFullAuditedObjectProperties()
.Ignore(x => x.Id)
.Ignore(x => x.TenantId)
.Ignore(x => x.Status)
.Ignore(x => x.LastExecutedAt)
.Ignore(x => x.ExecutionCount);
CreateMap<SqlStoredProcedure, SqlStoredProcedureDto>().Ignore(x => x.IsCustom);
CreateMap<CreateSqlStoredProcedureDto, SqlStoredProcedure>()
.IgnoreFullAuditedObjectProperties()
.Ignore(x => x.Id)
.Ignore(x => x.TenantId)
.Ignore(x => x.Status)
.Ignore(x => x.IsDeployed)
.Ignore(x => x.LastDeployedAt);
CreateMap<UpdateSqlStoredProcedureDto, SqlStoredProcedure>()
.IgnoreFullAuditedObjectProperties()
.Ignore(x => x.Id)
.Ignore(x => x.TenantId)
.Ignore(x => x.ProcedureName)
.Ignore(x => x.SchemaName)
.Ignore(x => x.DataSourceCode)
.Ignore(x => x.Status)
.Ignore(x => x.IsDeployed)
.Ignore(x => x.LastDeployedAt);
CreateMap<SqlView, SqlViewDto>().Ignore(x => x.IsCustom);
CreateMap<CreateSqlViewDto, SqlView>()
.IgnoreFullAuditedObjectProperties()
.Ignore(x => x.Id)
.Ignore(x => x.TenantId)
.Ignore(x => x.Status)
.Ignore(x => x.IsDeployed)
.Ignore(x => x.LastDeployedAt);
CreateMap<UpdateSqlViewDto, SqlView>()
.IgnoreFullAuditedObjectProperties()
.Ignore(x => x.Id)
.Ignore(x => x.TenantId)
.Ignore(x => x.ViewName)
.Ignore(x => x.SchemaName)
.Ignore(x => x.DataSourceCode)
.Ignore(x => x.Status)
.Ignore(x => x.IsDeployed)
.Ignore(x => x.LastDeployedAt);
CreateMap<SqlFunction, SqlFunctionDto>().Ignore(x => x.IsCustom);
CreateMap<CreateSqlFunctionDto, SqlFunction>()
.IgnoreFullAuditedObjectProperties()
.Ignore(x => x.Id)
.Ignore(x => x.TenantId)
.Ignore(x => x.Status)
.Ignore(x => x.IsDeployed)
.Ignore(x => x.LastDeployedAt);
CreateMap<UpdateSqlFunctionDto, SqlFunction>()
.IgnoreFullAuditedObjectProperties()
.Ignore(x => x.Id)
.Ignore(x => x.TenantId)
.Ignore(x => x.FunctionName)
.Ignore(x => x.SchemaName)
.Ignore(x => x.FunctionType)
.Ignore(x => x.DataSourceCode)
.Ignore(x => x.Status)
.Ignore(x => x.IsDeployed)
.Ignore(x => x.LastDeployedAt);
}
}