Exemple #1
0
        public override void Delete(DbItem item)
        {
            if (!IsAuthenticated)
            {
                throw AuthException.NotLoggedIn();
            }

            _dataService.Delete(item);
        }
        private TcpMessage HandleDeleteRelation(TcpConnectedHost host, TcpMessage message)
        {
            if (!message.HasType(TcpRequestType.DeleteRelation))
            {
                return(null);
            }

            if (!IsAuthenticated(host))
            {
                throw AuthException.NotLoggedIn();
            }

            var request = new ObjectTcpMessage <DbRelation>(message);

            var relation = request.Item;

            if (relation != null)
            {
                _dataService.Delete(relation);
            }

            return(new TcpMessage(TcpRequestType.Ok));
        }
Exemple #3
0
        public static void Remove <T>(T obj, int?fromId, DataServiceBase dataService)
        {
            var proxy = obj as IProxy;

            if (proxy == null)
            {
                return;
            }

            var relations = dataService.GetRelations(fromId);

            foreach (var relation in relations)
            {
                if (relation.ToId == proxy.SDBId)
                {
                    dataService.Delete(relation);
                }
            }
        }