Exemple #1
0
        public AllianceDataModel GetAllianceById(IDbConnection connection, int allianceId, bool deactivated)
        {
            var alliance = _aCache.GetById(connection, allianceId, true);

            if (!deactivated)
            {
                return(alliance.Disbandet ? null : alliance);
            }
            if (alliance == null)
            {
                return(_aRepo.GetModelById(connection, allianceId));
            }
            return(alliance);
        }
Exemple #2
0
        public bool TryUpdateKey(IDbConnection connection, IAllianceNameSerchItem newVal, string oldKeyName,
                                 string newKeyName, IAllianceLocalStorageCache cache, bool updateParentCahce = true)
        {
            _checkAndInit(connection, cache);
            IAllianceNameSerchItem val;

            if (!_storage.TryUpdateKey(oldKeyName, newKeyName, out val))
            {
                return(false);
            }
            if (!updateParentCahce)
            {
                return(true);
            }
            var alliane = cache.GetById(connection, newVal.Id, true);

            alliane.Name = newKeyName;
            var result = cache.UpdateLocalItem(connection, alliane);

            return(result.Name == newKeyName);
        }