mirror of https://github.com/abpframework/abp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
973 B
32 lines
973 B
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();
|
|
|
|
foreach (var connectionString in tenant.ConnectionStrings)
|
|
{
|
|
connStrings[connectionString.Name] = connectionString.Value;
|
|
}
|
|
|
|
return connStrings;
|
|
});
|
|
})
|
|
.ForMember(x => x.IsActive, x => x.UseDestinationValue());
|
|
|
|
CreateMap<Tenant, TenantEto>();
|
|
}
|
|
}
|
|
}
|