Exemple #1
0
        public void UpdateSpeakerProfile(string bio, Uri imageUrl, Uri blogUrl, bool isMvp, Uri mvpProfileUrl, bool travelAssistance)
        {
            var isNew = SpeakerProfile == null;

            if (isNew)
            {
                SpeakerProfile = new SpeakerProfile();
            }

            SpeakerProfile.Biography = bio;

            //if (imageUrl != null) SpeakerProfile.ImageUrl = imageUrl.ToString();
            SpeakerProfile.ImageUrl = imageUrl == null ? null : imageUrl.ToString();

            SpeakerProfile.BlogUrl       = blogUrl == null ? null : blogUrl.ToString();
            SpeakerProfile.IsMvp         = isMvp;
            SpeakerProfile.MvpProfileUrl = mvpProfileUrl == null ? null : mvpProfileUrl.ToString();

            if (SpeakerProfile.TravelAssistance != travelAssistance)
            {
                SpeakerProfile.TravelAssistance = travelAssistance;

                if (travelAssistance)
                {
                    Raise(new TravelAssistanceRequested {
                        UserId = Id
                    });
                }
                else
                {
                    Raise(new TravelAssistanceCancelled {
                        UserId = Id
                    });
                }
            }

            if (isNew)
            {
                Raise(new SpeakerCreated {
                    UserId = Id
                });
            }
        }
        public void UpdateSpeakerProfile(string bio, Uri imageUrl, Uri blogUrl, bool isMvp, Uri mvpProfileUrl, bool travelAssistance)
        {
            var isNew = SpeakerProfile == null;

            if (isNew)
                SpeakerProfile = new SpeakerProfile();

            SpeakerProfile.Biography = bio;

            //if (imageUrl != null) SpeakerProfile.ImageUrl = imageUrl.ToString();
            SpeakerProfile.ImageUrl = imageUrl == null ? null : imageUrl.ToString();

            SpeakerProfile.BlogUrl = blogUrl == null ? null : blogUrl.ToString();
            SpeakerProfile.IsMvp = isMvp;
            SpeakerProfile.MvpProfileUrl = mvpProfileUrl == null ? null : mvpProfileUrl.ToString();

            if (SpeakerProfile.TravelAssistance != travelAssistance)
            {
                SpeakerProfile.TravelAssistance = travelAssistance;

                if (travelAssistance)
                    Raise(new TravelAssistanceRequested {UserId = Id});
                else
                    Raise(new TravelAssistanceCancelled {UserId = Id});
            }

            if (isNew)
                Raise(new SpeakerCreated {UserId = Id});
        }