Beispiel #1
0
        public async Task SeedAsync(DataSeedContext context)
        {
            await _clubPlayerRepository.InsertAsync(new ClubPlayer(
                                                        id : Guid.Parse("d6f4c147-22a2-475b-80bb-bacf18d08ce2"),
                                                        clubId : Guid.Parse("d772238a-9871-47d7-84d5-c45083799954"),
                                                        playerId : Guid.Parse("85ea0ccf-0fad-4c6f-b660-23e6004a777d"))
            {
                IsPrimaryClubOfPlayer = true
            });

            await _clubPlayerRepository.InsertAsync(new ClubPlayer(
                                                        id : Guid.Parse("2bbaae46-29fe-4b1c-99f8-63a9296204cf"),
                                                        clubId : Guid.Parse("51b646da-9b05-454a-8fed-39371f1c6710"),
                                                        playerId : Guid.Parse("85ea0ccf-0fad-4c6f-b660-23e6004a777d"))
            {
                IsPrimaryClubOfPlayer = false
            });

            await _clubPlayerRepository.InsertAsync(new ClubPlayer(
                                                        id : Guid.Parse("7278ac73-6d82-459b-9289-aa760dcb2722"),
                                                        clubId : Guid.Parse("d772238a-9871-47d7-84d5-c45083799954"),
                                                        playerId : Guid.Parse("7b0b86ff-df6b-4b5f-8f6c-a226d00949cc"))
            {
                IsPrimaryClubOfPlayer = true
            });
        }
        public virtual async Task <ClubPlayerDto> AddPlayerAsync(Guid id, Guid playerId)
        {
            ClubPlayer clubPlayer = await _clubPlayerManager.CreateClubPlayerAsync(id, playerId);

            clubPlayer = await _clubPlayerRepository.InsertAsync(clubPlayer);

            return(ObjectMapper.Map <ClubPlayer, ClubPlayerDto>(clubPlayer));
        }