mirror of https://github.com/abpframework/abp.git
15 changed files with 222 additions and 100 deletions
@ -1,12 +0,0 @@ |
|||
using AutoMapper; |
|||
|
|||
namespace Volo.Abp.TenantManagement; |
|||
|
|||
public class AbpTenantManagementApplicationAutoMapperProfile : Profile |
|||
{ |
|||
public AbpTenantManagementApplicationAutoMapperProfile() |
|||
{ |
|||
CreateMap<Tenant, TenantDto>() |
|||
.MapExtraProperties(); |
|||
} |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
using Riok.Mapperly.Abstractions; |
|||
using Volo.Abp.Mapperly; |
|||
|
|||
namespace Volo.Abp.TenantManagement.Application.Volo.Abp.TenantManagement; |
|||
|
|||
[Mapper] |
|||
public partial class TenantToTenantDtoMapper |
|||
: MapperBase<Tenant, TenantDto> |
|||
{ |
|||
[MapperIgnoreSource(nameof(Tenant.EntityVersion))] |
|||
[MapperIgnoreSource(nameof(Tenant.ConnectionStrings))] |
|||
[MapperIgnoreSource(nameof(Tenant.IsDeleted))] |
|||
[MapperIgnoreSource(nameof(Tenant.NormalizedName))] |
|||
[MapperIgnoreSource(nameof(Tenant.DeleterId))] |
|||
[MapperIgnoreSource(nameof(Tenant.DeletionTime))] |
|||
[MapperIgnoreSource(nameof(Tenant.LastModificationTime))] |
|||
[MapperIgnoreSource(nameof(Tenant.LastModifierId))] |
|||
[MapperIgnoreSource(nameof(Tenant.CreationTime))] |
|||
[MapperIgnoreSource(nameof(Tenant.CreatorId))] |
|||
public override partial TenantDto Map(Tenant source); |
|||
|
|||
[MapperIgnoreSource(nameof(Tenant.EntityVersion))] |
|||
[MapperIgnoreSource(nameof(Tenant.ConnectionStrings))] |
|||
[MapperIgnoreSource(nameof(Tenant.IsDeleted))] |
|||
[MapperIgnoreSource(nameof(Tenant.NormalizedName))] |
|||
[MapperIgnoreSource(nameof(Tenant.DeleterId))] |
|||
[MapperIgnoreSource(nameof(Tenant.DeletionTime))] |
|||
[MapperIgnoreSource(nameof(Tenant.LastModificationTime))] |
|||
[MapperIgnoreSource(nameof(Tenant.LastModifierId))] |
|||
[MapperIgnoreSource(nameof(Tenant.CreationTime))] |
|||
[MapperIgnoreSource(nameof(Tenant.CreatorId))] |
|||
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,15 @@ |
|||
using Riok.Mapperly.Abstractions; |
|||
using Volo.Abp.Mapperly; |
|||
|
|||
namespace Volo.Abp.TenantManagement.Blazor; |
|||
|
|||
[Mapper] |
|||
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,89 @@ |
|||
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] |
|||
public partial class TenantToTenantConfigurationMapper |
|||
: MapperBase<Tenant, TenantConfiguration> |
|||
{ |
|||
[MapperIgnoreSource(nameof(Tenant.DeleterId))] |
|||
[MapperIgnoreSource(nameof(Tenant.DeletionTime))] |
|||
[MapperIgnoreSource(nameof(Tenant.LastModificationTime))] |
|||
[MapperIgnoreSource(nameof(Tenant.CreationTime))] |
|||
[MapperIgnoreSource(nameof(Tenant.CreatorId))] |
|||
[MapperIgnoreSource(nameof(Tenant.LastModifierId))] |
|||
[MapperIgnoreSource(nameof(Tenant.ExtraProperties))] |
|||
[MapperIgnoreSource(nameof(Tenant.ConcurrencyStamp))] |
|||
[MapperIgnoreSource(nameof(Tenant.IsDeleted))] |
|||
[MapperIgnoreSource(nameof(Tenant.EntityVersion))] |
|||
[MapperIgnoreTarget(nameof(TenantConfiguration.EditionId))] |
|||
[MapperIgnoreTarget(nameof(TenantConfiguration.IsActive))] |
|||
public override partial TenantConfiguration Map(Tenant source); |
|||
|
|||
[MapperIgnoreSource(nameof(Tenant.DeleterId))] |
|||
[MapperIgnoreSource(nameof(Tenant.DeletionTime))] |
|||
[MapperIgnoreSource(nameof(Tenant.IsDeleted))] |
|||
[MapperIgnoreSource(nameof(Tenant.LastModificationTime))] |
|||
[MapperIgnoreSource(nameof(Tenant.LastModifierId))] |
|||
[MapperIgnoreSource(nameof(Tenant.CreationTime))] |
|||
[MapperIgnoreSource(nameof(Tenant.CreatorId))] |
|||
[MapperIgnoreSource(nameof(Tenant.ExtraProperties))] |
|||
[MapperIgnoreSource(nameof(Tenant.ConcurrencyStamp))] |
|||
[MapperIgnoreSource(nameof(Tenant.EntityVersion))] |
|||
[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] |
|||
public partial class TenantToTenantEtoMapper |
|||
: MapperBase<Tenant, TenantEto> |
|||
{ |
|||
[MapperIgnoreSource(nameof(Tenant.ConnectionStrings))] |
|||
[MapperIgnoreSource(nameof(Tenant.IsDeleted))] |
|||
[MapperIgnoreSource(nameof(Tenant.NormalizedName))] |
|||
[MapperIgnoreSource(nameof(Tenant.DeleterId))] |
|||
[MapperIgnoreSource(nameof(Tenant.DeletionTime))] |
|||
[MapperIgnoreSource(nameof(Tenant.LastModificationTime))] |
|||
[MapperIgnoreSource(nameof(Tenant.LastModifierId))] |
|||
[MapperIgnoreSource(nameof(Tenant.CreationTime))] |
|||
[MapperIgnoreSource(nameof(Tenant.CreatorId))] |
|||
[MapperIgnoreSource(nameof(Tenant.ExtraProperties))] |
|||
[MapperIgnoreSource(nameof(Tenant.ConcurrencyStamp))] |
|||
public override partial TenantEto Map(Tenant source); |
|||
|
|||
[MapperIgnoreSource(nameof(Tenant.ConnectionStrings))] |
|||
[MapperIgnoreSource(nameof(Tenant.IsDeleted))] |
|||
[MapperIgnoreSource(nameof(Tenant.NormalizedName))] |
|||
[MapperIgnoreSource(nameof(Tenant.DeleterId))] |
|||
[MapperIgnoreSource(nameof(Tenant.DeletionTime))] |
|||
[MapperIgnoreSource(nameof(Tenant.LastModificationTime))] |
|||
[MapperIgnoreSource(nameof(Tenant.LastModifierId))] |
|||
[MapperIgnoreSource(nameof(Tenant.CreationTime))] |
|||
[MapperIgnoreSource(nameof(Tenant.CreatorId))] |
|||
[MapperIgnoreSource(nameof(Tenant.ExtraProperties))] |
|||
[MapperIgnoreSource(nameof(Tenant.ConcurrencyStamp))] |
|||
public override partial void Map(Tenant source, TenantEto destination); |
|||
} |
|||
@ -1,36 +1,36 @@ |
|||
using AutoMapper; |
|||
// using AutoMapper;
|
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.MultiTenancy; |
|||
|
|||
namespace Volo.Abp.TenantManagement; |
|||
|
|||
public class AbpTenantManagementDomainMappingProfile : Profile |
|||
public class AbpTenantManagementDomainMappingProfile //: Profile
|
|||
{ |
|||
public AbpTenantManagementDomainMappingProfile() |
|||
{ |
|||
CreateMap<Tenant, TenantConfiguration>() |
|||
.ForMember(ti => ti.ConnectionStrings, opts => |
|||
{ |
|||
opts.MapFrom((tenant, ti) => |
|||
{ |
|||
var connStrings = new ConnectionStrings(); |
|||
// CreateMap<Tenant, TenantConfiguration>()
|
|||
// .ForMember(ti => ti.ConnectionStrings, opts =>
|
|||
// {
|
|||
// opts.MapFrom((tenant, ti) =>
|
|||
// {
|
|||
// var connStrings = new ConnectionStrings();
|
|||
|
|||
if (tenant.ConnectionStrings == null) |
|||
{ |
|||
return connStrings; |
|||
} |
|||
// if (tenant.ConnectionStrings == null)
|
|||
// {
|
|||
// return connStrings;
|
|||
// }
|
|||
|
|||
foreach (var connectionString in tenant.ConnectionStrings) |
|||
{ |
|||
connStrings[connectionString.Name] = connectionString.Value; |
|||
} |
|||
// 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()); |
|||
// return connStrings;
|
|||
// });
|
|||
// })
|
|||
// .ForMember(x => x.IsActive, x => x.Ignore())
|
|||
// .ForMember(x => x.EditionId, x => x.Ignore());
|
|||
|
|||
CreateMap<Tenant, TenantEto>(); |
|||
// 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.Mapperly; |
|||
using Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants; |
|||
|
|||
namespace Volo.Abp.TenantManagement.Web; |
|||
|
|||
[Mapper] |
|||
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] |
|||
public partial class TenantInfoModelToTenantCreateDtoMapper |
|||
: MapperBase<EditModalModel.TenantInfoModel, TenantCreateDto> |
|||
{ |
|||
[MapperIgnoreSource(nameof(EditModalModel.TenantInfoModel.Id))] |
|||
[MapperIgnoreSource(nameof(EditModalModel.TenantInfoModel.ConcurrencyStamp))] |
|||
[MapperIgnoreTarget(nameof(TenantCreateDto.AdminEmailAddress))] |
|||
[MapperIgnoreTarget(nameof(TenantCreateDto.AdminPassword))] |
|||
public override partial TenantCreateDto Map(EditModalModel.TenantInfoModel source); |
|||
|
|||
[MapperIgnoreSource(nameof(EditModalModel.TenantInfoModel.Id))] |
|||
[MapperIgnoreSource(nameof(EditModalModel.TenantInfoModel.ConcurrencyStamp))] |
|||
[MapperIgnoreTarget(nameof(TenantCreateDto.AdminEmailAddress))] |
|||
[MapperIgnoreTarget(nameof(TenantCreateDto.AdminPassword))] |
|||
public override partial void Map(EditModalModel.TenantInfoModel source, TenantCreateDto destination); |
|||
} |
|||
|
|||
[Mapper] |
|||
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