mirror of https://github.com/abpframework/abp.git
committed by
GitHub
15 changed files with 140 additions and 115 deletions
@ -1,12 +0,0 @@ |
|||||
using AutoMapper; |
|
||||
|
|
||||
namespace Volo.Abp.TenantManagement; |
|
||||
|
|
||||
public class AbpTenantManagementApplicationAutoMapperProfile : Profile |
|
||||
{ |
|
||||
public AbpTenantManagementApplicationAutoMapperProfile() |
|
||||
{ |
|
||||
CreateMap<Tenant, TenantDto>() |
|
||||
.MapExtraProperties(); |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,13 @@ |
|||||
|
using Riok.Mapperly.Abstractions; |
||||
|
using Volo.Abp.Mapperly; |
||||
|
|
||||
|
namespace Volo.Abp.TenantManagement.Application.Volo.Abp.TenantManagement; |
||||
|
|
||||
|
[Mapper(RequiredMappingStrategy = RequiredMappingStrategy.Target)] |
||||
|
[MapExtraProperties] |
||||
|
public partial class TenantToTenantDtoMapper |
||||
|
: MapperBase<Tenant, TenantDto> |
||||
|
{ |
||||
|
public override partial TenantDto Map(Tenant source); |
||||
|
public override partial void Map(Tenant source, TenantDto destination); |
||||
|
} |
||||
@ -1,12 +0,0 @@ |
|||||
using AutoMapper; |
|
||||
|
|
||||
namespace Volo.Abp.TenantManagement.Blazor; |
|
||||
|
|
||||
public class AbpTenantManagementBlazorAutoMapperProfile : Profile |
|
||||
{ |
|
||||
public AbpTenantManagementBlazorAutoMapperProfile() |
|
||||
{ |
|
||||
CreateMap<TenantDto, TenantUpdateDto>() |
|
||||
.MapExtraProperties(); |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,16 @@ |
|||||
|
using Riok.Mapperly.Abstractions; |
||||
|
using Volo.Abp.Mapperly; |
||||
|
|
||||
|
namespace Volo.Abp.TenantManagement.Blazor; |
||||
|
|
||||
|
[Mapper] |
||||
|
[MapExtraProperties] |
||||
|
public partial class TenantDtoToTenantUpdateDtoMapper |
||||
|
: MapperBase<TenantDto, TenantUpdateDto> |
||||
|
{ |
||||
|
[MapperIgnoreSource(nameof(TenantDto.Id))] |
||||
|
public override partial TenantUpdateDto Map(TenantDto source); |
||||
|
|
||||
|
[MapperIgnoreSource(nameof(TenantDto.Id))] |
||||
|
public override partial void Map(TenantDto source, TenantUpdateDto destination); |
||||
|
} |
||||
@ -0,0 +1,47 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using Riok.Mapperly.Abstractions; |
||||
|
using Volo.Abp.Data; |
||||
|
using Volo.Abp.Mapperly; |
||||
|
using Volo.Abp.MultiTenancy; |
||||
|
|
||||
|
namespace Volo.Abp.TenantManagement.Domain.Volo.Abp.TenantManagement; |
||||
|
|
||||
|
[Mapper(RequiredMappingStrategy = RequiredMappingStrategy.Target)] |
||||
|
public partial class TenantToTenantConfigurationMapper |
||||
|
: MapperBase<Tenant, TenantConfiguration> |
||||
|
{ |
||||
|
[MapperIgnoreTarget(nameof(TenantConfiguration.EditionId))] |
||||
|
[MapperIgnoreTarget(nameof(TenantConfiguration.IsActive))] |
||||
|
public override partial TenantConfiguration Map(Tenant source); |
||||
|
|
||||
|
[MapperIgnoreTarget(nameof(TenantConfiguration.EditionId))] |
||||
|
[MapperIgnoreTarget(nameof(TenantConfiguration.IsActive))] |
||||
|
public override partial void Map(Tenant source, TenantConfiguration destination); |
||||
|
|
||||
|
protected virtual ConnectionStrings Map(List<TenantConnectionString> source) |
||||
|
{ |
||||
|
var connStrings = new ConnectionStrings(); |
||||
|
|
||||
|
if (source == null) |
||||
|
{ |
||||
|
return connStrings; |
||||
|
} |
||||
|
|
||||
|
foreach (var connectionString in source) |
||||
|
{ |
||||
|
connStrings[connectionString.Name] = connectionString.Value; |
||||
|
} |
||||
|
|
||||
|
return connStrings; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
[Mapper(RequiredMappingStrategy = RequiredMappingStrategy.Target)] |
||||
|
public partial class TenantToTenantEtoMapper |
||||
|
: MapperBase<Tenant, TenantEto> |
||||
|
{ |
||||
|
public override partial TenantEto Map(Tenant source); |
||||
|
|
||||
|
public override partial void Map(Tenant source, TenantEto destination); |
||||
|
} |
||||
@ -1,36 +0,0 @@ |
|||||
using AutoMapper; |
|
||||
using Volo.Abp.Data; |
|
||||
using Volo.Abp.MultiTenancy; |
|
||||
|
|
||||
namespace Volo.Abp.TenantManagement; |
|
||||
|
|
||||
public class AbpTenantManagementDomainMappingProfile : Profile |
|
||||
{ |
|
||||
public AbpTenantManagementDomainMappingProfile() |
|
||||
{ |
|
||||
CreateMap<Tenant, TenantConfiguration>() |
|
||||
.ForMember(ti => ti.ConnectionStrings, opts => |
|
||||
{ |
|
||||
opts.MapFrom((tenant, ti) => |
|
||||
{ |
|
||||
var connStrings = new ConnectionStrings(); |
|
||||
|
|
||||
if (tenant.ConnectionStrings == null) |
|
||||
{ |
|
||||
return connStrings; |
|
||||
} |
|
||||
|
|
||||
foreach (var connectionString in tenant.ConnectionStrings) |
|
||||
{ |
|
||||
connStrings[connectionString.Name] = connectionString.Value; |
|
||||
} |
|
||||
|
|
||||
return connStrings; |
|
||||
}); |
|
||||
}) |
|
||||
.ForMember(x => x.IsActive, x => x.Ignore()) |
|
||||
.ForMember(x => x.EditionId, x => x.Ignore()); |
|
||||
|
|
||||
CreateMap<Tenant, TenantEto>(); |
|
||||
} |
|
||||
} |
|
||||
@ -1,22 +0,0 @@ |
|||||
using AutoMapper; |
|
||||
using Volo.Abp.AutoMapper; |
|
||||
using Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants; |
|
||||
|
|
||||
namespace Volo.Abp.TenantManagement.Web; |
|
||||
|
|
||||
public class AbpTenantManagementWebAutoMapperProfile : Profile |
|
||||
{ |
|
||||
public AbpTenantManagementWebAutoMapperProfile() |
|
||||
{ |
|
||||
//List
|
|
||||
CreateMap<TenantDto, EditModalModel.TenantInfoModel>(); |
|
||||
|
|
||||
//CreateModal
|
|
||||
CreateMap<CreateModalModel.TenantInfoModel, TenantCreateDto>() |
|
||||
.MapExtraProperties(); |
|
||||
|
|
||||
//EditModal
|
|
||||
CreateMap<EditModalModel.TenantInfoModel, TenantUpdateDto>() |
|
||||
.MapExtraProperties(); |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,50 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using Riok.Mapperly.Abstractions; |
||||
|
using Volo.Abp.DependencyInjection; |
||||
|
using Volo.Abp.Mapperly; |
||||
|
using Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants; |
||||
|
|
||||
|
namespace Volo.Abp.TenantManagement.Web; |
||||
|
|
||||
|
[Mapper] |
||||
|
[MapExtraProperties] |
||||
|
public partial class TenantDtoToTenantInfoModelMapper |
||||
|
: MapperBase<TenantDto, EditModalModel.TenantInfoModel> |
||||
|
{ |
||||
|
public override partial EditModalModel.TenantInfoModel Map(TenantDto source); |
||||
|
|
||||
|
public override partial void Map(TenantDto source, EditModalModel.TenantInfoModel destination); |
||||
|
} |
||||
|
|
||||
|
[Mapper] |
||||
|
[MapExtraProperties] |
||||
|
public partial class CreateTenantInfoModelToTenantCreateDtoMapper |
||||
|
: TwoWayMapperBase<CreateModalModel.TenantInfoModel, TenantCreateDto> |
||||
|
{ |
||||
|
public override partial TenantCreateDto Map(CreateModalModel.TenantInfoModel source); |
||||
|
|
||||
|
public override partial void Map(CreateModalModel.TenantInfoModel source, TenantCreateDto destination); |
||||
|
|
||||
|
public override partial CreateModalModel.TenantInfoModel ReverseMap(TenantCreateDto source); |
||||
|
|
||||
|
public override partial void ReverseMap(TenantCreateDto source, CreateModalModel.TenantInfoModel destination); |
||||
|
} |
||||
|
|
||||
|
[Mapper] |
||||
|
[MapExtraProperties] |
||||
|
public partial class TenantInfoModelToTenantUpdateDtoMapper |
||||
|
: MapperBase<EditModalModel.TenantInfoModel, TenantUpdateDto> |
||||
|
{ |
||||
|
[MapperIgnoreSource(nameof(EditModalModel.TenantInfoModel.Id))] |
||||
|
[MapperIgnoreSource(nameof(EditModalModel.TenantInfoModel.ConcurrencyStamp))] |
||||
|
[MapperIgnoreTarget(nameof(TenantUpdateDto.ConcurrencyStamp))] |
||||
|
public override partial TenantUpdateDto Map(EditModalModel.TenantInfoModel source); |
||||
|
|
||||
|
[MapperIgnoreSource(nameof(EditModalModel.TenantInfoModel.Id))] |
||||
|
[MapperIgnoreSource(nameof(EditModalModel.TenantInfoModel.ConcurrencyStamp))] |
||||
|
[MapperIgnoreTarget(nameof(TenantUpdateDto.ConcurrencyStamp))] |
||||
|
public override partial void Map(EditModalModel.TenantInfoModel source, TenantUpdateDto destination); |
||||
|
} |
||||
Loading…
Reference in new issue