public List <AssetNetworkPort> Resolve(NetworkConnectionDto source, NetworkConnection destination, List <AssetNetworkPort> destMember, ResolutionContext context)
 {
     return(source.Ports
            .Select(o =>
     {
         var port = _networkRepo.GetNetworkPort(o.Id);
         // overwrite the mac address with what has been provided
         port.MacAddress = o.MacAddress;
         return port;
     })
            .ToList());
 }
        public void Process(AssetNetworkPortDto source, AssetNetworkPort destination, ResolutionContext context)
        {
            if (!source.ConnectedPortId.HasValue)
            {
                return;
            }

            destination.NetworkConnection = new NetworkConnection
            {
                Ports = new List <AssetNetworkPort>
                {
                    destination,
                    _repo.GetNetworkPort(source.ConnectedPortId.Value)
                }
            };
        }
Esempio n. 3
0
        public AssetNetworkPortDto GetNetworkPort(string hostname, string portName)
        {
            var port = _repository.GetNetworkPort(hostname, portName);

            return(_mapper.Map <AssetNetworkPortDto>(port));
        }