예제 #1
0
        public static DeviceModel FromRepositoryType(Device model, DbSet<NetworkModel> networks)
        {
            var result = new DeviceModel
            {
                Address = model.Address,
                CurrentAction = model.CurrentAction,
                Id = model.Id,
                IsConnected = model.IsConnected,
                LastPing = model.LastPing,
                Name = model.Name,
                Network = (model.Network == null) ? null : networks.Find(model.Network.Id),
                Notes = model.ToXElement().ToString(),
                Type = model.Type
            };

            return result;
        }
예제 #2
0
        public bool Equals(DeviceModel that)
        {
            if (that == null)
            {
                return false;
            }

            if (this.Address != that.Address)
            {
                return false;
            }

            if (!NetworkModel.Equals(this.Network, that.Network))
            {
                return false;
            }

            return true;
        }