57 lines
2.0 KiB
C#
57 lines
2.0 KiB
C#
using Microsoft.SelfService.Portal.Core.API.Models;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace Microsoft.SelfService.Portal.Core.API.Dto.Environment.Get
|
|
{
|
|
public class GetEnvironmentDomainDto : BaseDetailsDto
|
|
{
|
|
[Column(Order = 1)]
|
|
public string Name { get; set; }
|
|
|
|
[Column(Order = 2)]
|
|
public string EnvironmentType { get; set; }
|
|
|
|
[Column(Order = 3)]
|
|
public string HostingType { get; set; }
|
|
|
|
[Column(Order = 4)]
|
|
public string? ProviderType { get; set; }
|
|
|
|
[Column(Order = 5)]
|
|
public string? TenantId { get; set; }
|
|
|
|
[Column(Order = 6)]
|
|
public string? SubscriptionId { get; set; }
|
|
|
|
[Column(Order = 7)]
|
|
public string? MetadataJson { get; set; }
|
|
|
|
[Column(Order = 8)]
|
|
public ICollection<GetEnvironmentDomainDetailsDto> EnvironmentDomains { get; set; }
|
|
|
|
public static GetEnvironmentDomainDto FromModel(EnvironmentModel environment)
|
|
{
|
|
return new GetEnvironmentDomainDto
|
|
{
|
|
Id = environment.Id,
|
|
Name = environment.Name,
|
|
EnvironmentType = environment.EnvironmentType,
|
|
HostingType = environment.HostingType,
|
|
ProviderType = environment.ProviderType,
|
|
TenantId = environment.TenantId,
|
|
SubscriptionId = environment.SubscriptionId,
|
|
MetadataJson = environment.MetadataJson,
|
|
Created = environment.Created,
|
|
CreatedBy = environment.CreatedBy,
|
|
Modified = environment.Modified,
|
|
ModifiedBy = environment.ModifiedBy,
|
|
EnvironmentDomains = environment.EnvironmentDomains?
|
|
.Where(environmentDomain => environmentDomain.Domain != null)
|
|
.Select(GetEnvironmentDomainDetailsDto.FromModel)
|
|
.ToList() ?? new List<GetEnvironmentDomainDetailsDto>()
|
|
};
|
|
}
|
|
}
|
|
}
|
|
|