示例#1
0
        public OperationResult<UserTvEpisode> AddUserTvEpisode(UserTvEpisode userEpisode)
        {
            if(GetUserTvEpisode(userEpisode.TvEpisodeKey, userEpisode.OwnerKey) != null)
            {
                return new OperationResult<UserTvEpisode>(false);
            }

            userEpisode.Key = Guid.NewGuid();
            _userTvEpisodeRepository.Add(userEpisode);
            _userTvEpisodeRepository.Save();

            return new OperationResult<UserTvEpisode>(true) {Entity = userEpisode};
        }
示例#2
0
        public UserTvEpisode UpdateUserTvEpisode(UserTvEpisode userEpisode)
        {
            _userTvEpisodeRepository.Edit(userEpisode);
            _userTvEpisodeRepository.Save();

            return userEpisode;
        }