public static IEnumerable <ServiceProxyDTOModel> GetDTOModels(this ServiceProxyModel proxy) { var dtos = proxy.Operations .SelectMany(x => x.Parameters) .SelectMany(x => GetTypeModels(x.TypeReference)) .Concat(proxy.Operations.Where(x => x.TypeReference.Element != null).SelectMany(x => GetTypeModels(x.TypeReference))) .ToList(); foreach (var dto in dtos.ToList()) { dtos.AddRange(((IElement)dto).GetChildDTOs()); } return(dtos .Where(x => x.SpecializationTypeId != TypeDefinitionModel.SpecializationTypeId && x.SpecializationTypeId != EnumModel.SpecializationTypeId) .Select(x => new ServiceProxyDTOModel((IElement)x, proxy)).ToList() .Distinct() .ToList()); }
public bool Equals(ServiceProxyModel other) { return(Equals(_element, other?._element)); }
public ServiceProxyDTOModel(IElement element, ServiceProxyModel serviceProxy) : base(element, SpecializationType) { ServiceProxy = serviceProxy; }