public async Task<bool> RegisterCoach(CoachSignUpDM coachSignUp)
        {
            using (var context = new LearningFivesEntities())
            {
                context.CoachSignUps.Add(new CoachSignUp
                {
                    CoachStatus = coachSignUp.CoachStatus,
                    SummonerInfo = new SummonerInfo
                    {
                        SummonerName = coachSignUp.SummonerInfo.SummonerName,
                        ServerName = coachSignUp.SummonerInfo.Server,
                        RankTier = coachSignUp.SummonerInfo.RankTier,
                        RankDivision = coachSignUp.SummonerInfo.RankDivision,
                        Age = coachSignUp.SummonerInfo.Age,
                        Email = coachSignUp.SummonerInfo.Email,
                        HasSlackAccount = coachSignUp.SummonerInfo.HasSlackAccount
                    },
                    InterestedBronze = coachSignUp.InterestedBronze,
                    InterestedSilver = coachSignUp.InterestedSilver,
                    InterestedGold = coachSignUp.InterestedGold,
                    InterestedPlat = coachSignUp.InterestedPlat,
                    InterestedDiamond = coachSignUp.InterestedDiamond,

                    WillingBronze = coachSignUp.WillingBronze,
                    WillingSilver = coachSignUp.WillingSilver,
                    WillingGold = coachSignUp.WillingGold,
                    WillingPlat = coachSignUp.WillingPlat,
                    WillingDiamond = coachSignUp.WillingDiamond,

                    AvailabilityInfo = new AvailabilityInfo
                    {
                        MondayStart = coachSignUp.AvailabilityInfo.MondayStart,
                        MondayEnd = coachSignUp.AvailabilityInfo.MondayEnd,
                        TuesdayStart = coachSignUp.AvailabilityInfo.TuesdayStart,
                        TuesdayEnd = coachSignUp.AvailabilityInfo.TuesdayEnd,
                        WednesdayStart = coachSignUp.AvailabilityInfo.WednesdayStart,
                        WednesdayEnd = coachSignUp.AvailabilityInfo.WednesdayEnd,
                        ThursdayStart = coachSignUp.AvailabilityInfo.ThursdayStart,
                        ThursdayEnd = coachSignUp.AvailabilityInfo.ThursdayEnd,
                        FridayStart = coachSignUp.AvailabilityInfo.FridayStart,
                        FridayEnd = coachSignUp.AvailabilityInfo.FridayEnd,
                        SaturdayStart = coachSignUp.AvailabilityInfo.SaturdayStart,
                        SaturdayEnd = coachSignUp.AvailabilityInfo.SaturdayEnd,
                        SundayStart = coachSignUp.AvailabilityInfo.SundayStart,
                        SundayEnd = coachSignUp.AvailabilityInfo.SundayEnd
                    },
                    Languages = coachSignUp.Languages,
                    PairedPlayers = coachSignUp.PairedPlayers,
                    CoachingStyle = coachSignUp.CoachingStyle,
                    CoachingExperience = coachSignUp.CoachingExperience,
                    Commitment = new Commitment
                    {
                        CommitmentLevel = coachSignUp.Commitment.CommitmentLevel,
                        SeriousnessLevel = coachSignUp.Commitment.SeriousnessLevel
                    },
                    Toxic = new Toxic
                    {
                        ToxicLevel = coachSignUp.Toxic.ToxicLevel,
                        HadLowPriorityPunish = coachSignUp.Toxic.HadLowPriorityPunish,
                        HadChatRestriction = coachSignUp.Toxic.HadChatRestrictions,
                        HadRankedRestrictions = coachSignUp.Toxic.HadRankedRestrictions,
                        HadTemporaryBan = coachSignUp.Toxic.HadTemporaryBan,
                        HadPermanentBan = coachSignUp.Toxic.HadPermanentBan
                    },
                    MoreInformation = coachSignUp.MoreInformation,
                    EmailSignUp = coachSignUp.EmailSignUp
                });

                return await context.SaveChangesAsync() > 0;
            }
        }
Beispiel #2
0
 public async Task<bool> RegisterCoach(CoachSignUpDM coachSignUp)
 {
     return await _signUpDataAccessor.RegisterCoach(coachSignUp);
 }