コード例 #1
0
        public async Task <bool> KickPlayer(int clubId, int playerId)
        {
            Club club = await GetClubById(clubId);

            if (club == null)
            {
                return(false);
            }

            Member player = await _membersRepository.GetPlayerById(playerId);

            if (player == null)
            {
                return(false);
            }

            bool isSuccess = true;

            if (club.Members.Contains(player))
            {
                isSuccess = club.Members.Remove(player);
            }

            return(isSuccess);
        }
コード例 #2
0
ファイル: MembersService.cs プロジェクト: DIdo94/BLink
 public Task <Member> GetPlayerById(int playerId)
 {
     return(_membersRepository.GetPlayerById(playerId));
 }