Esempio n. 1
0
        /// <summary>
        /// 添加文件夹
        /// </summary>
        /// <param name="space"></param>
        /// <returns></returns>
        public SpaceObject Add(SpaceObject space)
        {
            _logger.Info("Add");

            space = _spaceRepository.Add(space.ToEntity<Space>()).ToObject<SpaceObject>();
            if (space != null)
            {
                _bus.Send(new CreateSpaceMessage { Content = space });
                _cacheService.Add(space);
            }

            return space;
        }
Esempio n. 2
0
        /// <summary>
        /// 修改文件夹
        /// </summary>
        /// <param name="space"></param>
        /// <returns></returns>
        public SpaceObject Update(SpaceObject space)
        {
            _logger.Info("Update");

            space = _spaceRepository.Update(f => f.Id == space.Id, space.ToEntity<Space>()).ToObject<SpaceObject>();
            if (space != null)
            {
                _cacheService.Update(space);
                _bus.Send(new UpdateSpaceMessage { Content = space });
            }

            return space;
        }