示例#1
0
        //todo user удаление связей
        public bool Delete(IDbConnection connection, int userId)
        {
            throw new NotImplementedException();
            var old = _userCache.GetById(connection, userId, true);

            if (old == null)
            {
                return(true);
            }
            var sucsess = _userRepo.Delete(connection, userId);

            // _provider.Commit();
            if (sucsess)
            {
                _userCache.DeleteItem(userId);
            }
            else
            {
                throw new NotImplementedException(Error.ErrorInUpdateDb);
            }
        }
示例#2
0
        public bool TryUpdateKey(IDbConnection connection, int userId, string oldUserName, string newUserName,
                                 IUserLocalStorageCache cache, bool updateParentCahce = true)
        {
            _checkAndInit(connection, cache);
            int id;

            if (!_storage.TryUpdateKey(oldUserName, newUserName, out id))
            {
                return(false);
            }
            if (!updateParentCahce)
            {
                return(true);
            }
            var user = cache.GetById(connection, id, true);

            user.Nickname = newUserName;
            var result = cache.UpdateLocalItem(connection, user);

            return(result.Nickname == newUserName);
        }