示例#1
0
 private Gateway ConvertoModel(Domain.Domain.Gateway gw)
 {
     return(new Gateway()
     {
         id = gw.id,
         ipv4 = gw.ipv4,
         serial = gw.serial,
         Peripheral = gw.Peripheral != null?gw.Peripheral.Select(i => ConvertoModel(i)).ToList() : null
     });
 }
示例#2
0
        private Domain.Domain.Gateway ConvertToDomain(Gateway gateway)
        {
            var r = new Domain.Domain.Gateway()
            {
                ipv4   = gateway.ipv4,
                serial = gateway.serial,
                id     = gateway.id
            };

            if (gateway.Peripheral != null)
            {
                r.Peripheral = gateway.Peripheral.Select(i => ConvetToDomain(i)).ToList();
            }
            return(r);
        }