/// <summary> /// Adds the given /// </summary> /// <param name="socialable">The socialable entity.</param> /// <returns>The social media that should be added to the context.</returns> public SocialMedia AddSocialMediaPresence(ISocialable socialable) { Contract.Requires(socialable != null, "The socialable entity must not be null."); Contract.Requires(socialable.SocialMedias != null, "The social medias property must not be null."); var socialMedia = new SocialMedia { SocialMediaTypeId = this.SocialMediaTypeId, SocialMediaValue = this.Value }; this.Create.SetHistory(socialMedia); socialable.SocialMedias.Add(socialMedia); return(socialMedia); }
private SocialMedia DoCreate <T>(SocialMediaPresence <T> socialMedia, ISocialable socialable) where T : class, ISocialable { throwIfSocialableEntityNotFound(socialable, socialMedia.GetSocialableEntityId()); return(socialMedia.AddSocialMediaPresence(socialable)); }