private bool SocketIsUnlinked(Socket socket) { return socket.ConnectedToSocketId == null; }
private void AddNewSocketToDevice(Device selectedDevice, Socket socket) { _context.Sockets.CreateNewLinkedSocket(selectedDevice, socket); _context.Complete(); }
private void Socket_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { var device = new Socket(); switch (e.Action) { case NotifyCollectionChangedAction.Add: foreach (var item in e.NewItems) { var entity = item as Socket; if (entity != null && !_isAddedbyApp) { //Adding to the database is working by itself! } } _context.Complete(); break; case NotifyCollectionChangedAction.Reset: var count = _context.Complete(); break; } }