コード例 #1
0
ファイル: ProfileManager.cs プロジェクト: reecebedding/EveCM
        public void AssociateCharacter(ApplicationUser user, CharacterDetails character)
        {
            IEnumerable <CharacterDetails> existingCharacters = _characterRepository.GetCharactersForUser(user);

            try
            {
                _characterRepository.AddCharacterToAccount(user, character);
                if (existingCharacters.Count() == 0)
                {
                    SetCharacterAsPrimary(user, character);
                }
            }
            catch (Data.Repositories.PSQL.Exceptions.CharacterAlreadyAssignedException ex)
            {
                throw new Exceptions.CharacterAlreadyAssignedException();
            }
        }