/// <summary> /// Updates the ECA system's social media data with the given updated social media. /// </summary> /// <param name="updatedSocialMedia">The updated social media.</param> public void Update(UpdatedSocialMediaPresence updatedSocialMedia) { var socialMedia = Context.SocialMedias.Find(updatedSocialMedia.Id); ParticipantPersonSevisDTO participant = null; if (socialMedia != null && socialMedia.PersonId.HasValue) { participant = GetParticipantByPersonId((int)socialMedia.PersonId); } DoUpdate(updatedSocialMedia, socialMedia, participant); }
private void DoUpdate(UpdatedSocialMediaPresence updatedSocialMedia, SocialMedia modelToUpdate, ParticipantPersonSevisDTO participant) { Contract.Requires(updatedSocialMedia != null, "The updatedSocialMedia must not be null."); throwIfSocialMediaNotFound(modelToUpdate, updatedSocialMedia.Id); if (participant != null) { throwValidationErrorIfParticipantSevisInfoIsLocked(participant); } modelToUpdate.SocialMediaTypeId = updatedSocialMedia.SocialMediaTypeId; modelToUpdate.SocialMediaValue = updatedSocialMedia.Value; updatedSocialMedia.Update.SetHistory(modelToUpdate); }
/// <summary> /// Updates the ECA system's social media data with the given updated social media. /// </summary> /// <param name="updatedSocialMedia">The updated social media.</param> public async Task UpdateAsync(UpdatedSocialMediaPresence updatedSocialMedia) { var socialMedia = await Context.SocialMedias.FindAsync(updatedSocialMedia.Id); ParticipantPersonSevisDTO participant = null; if (socialMedia != null && socialMedia.PersonId.HasValue) { participant = await GetParticipantByPersonIdAsync((int)socialMedia.PersonId); } DoUpdate(updatedSocialMedia, socialMedia, participant); }
/// <summary> /// /// </summary> /// <param name="updatedSocialMedia"></param> /// <returns></returns> public Task UpdateAsync(UpdatedSocialMediaPresence updatedSocialMedia) { Contract.Requires(updatedSocialMedia != null, "The updated social media must not be null."); return(Task.FromResult <object>(null)); }
/// <summary> /// /// </summary> /// <param name="updatedSocialMedia"></param> public void Update(UpdatedSocialMediaPresence updatedSocialMedia) { Contract.Requires(updatedSocialMedia != null, "The updated social media must not be null."); }