Beispiel #1
0
        public void ClubBuildTest()
        {
            AircraftTest      aircraftTest      = new AircraftTest();
            ClubAddMemberTest clubAddMemberTest = new ClubAddMemberTest();

            aircraftTest.AircraftBuild();
            club.AddAircraft(aircraftTest.aircraft);

            clubAddMemberTest.CreateMembers();
            foreach (var m in clubAddMemberTest.club.Members)
            {
                club.AddMember(m);
            }
        }
        public async Task <bool> AddAircraftToClub(string clubName, int aircraftId)
        {
            if (clubName == string.Empty || aircraftId <= 0)
            {
                return(await Task.FromResult(false));
            }
            var clubSpec = new ClubWithSpecification(clubName);

            Club     club     = await(_clubRepository.GetAllByIdAsync(clubSpec));
            Aircraft aircraft = await _asyncRepositoryAircraft.GetByIdAsync(aircraftId);

            if (club != null && aircraft != null)
            {
                club.AddAircraft(aircraft);
                await _clubRepository.UpdateAsync(club);

                return(await Task.FromResult(true));
            }
            return(await Task.FromResult(false));
        }