Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -1,11 +1,34 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.SelfService.Portal.Core.API.Dto.Domain.Get;
|
||||
using Microsoft.SelfService.Portal.Core.API.Models;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Dto.Environment.Get
|
||||
{
|
||||
public class GetEnvironmentDomainDetailsDto : BaseDetailsDto
|
||||
{
|
||||
|
||||
[Column(Order = 1)]
|
||||
public ICollection<GetEnvironmentDetailsDto> Environment { get; set; }
|
||||
public GetDomainDetailsDto Domain { get; set; }
|
||||
|
||||
public static GetEnvironmentDomainDetailsDto FromModel(EnvironmentDomainsModel environmentDomain)
|
||||
{
|
||||
return new GetEnvironmentDomainDetailsDto
|
||||
{
|
||||
Created = environmentDomain.Created,
|
||||
CreatedBy = environmentDomain.CreatedBy,
|
||||
Modified = environmentDomain.Modified,
|
||||
ModifiedBy = environmentDomain.ModifiedBy,
|
||||
Domain = new GetDomainDetailsDto
|
||||
{
|
||||
Id = environmentDomain.Domain.Id,
|
||||
Name = environmentDomain.Domain.Name,
|
||||
FQDN = environmentDomain.Domain.FQDN,
|
||||
NetBIOS = environmentDomain.Domain.NetBIOS,
|
||||
Created = environmentDomain.Domain.Created,
|
||||
CreatedBy = environmentDomain.Domain.CreatedBy,
|
||||
Modified = environmentDomain.Domain.Modified,
|
||||
ModifiedBy = environmentDomain.Domain.ModifiedBy
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user