public static EditableBannerInfo ToEditable <T>(this BannerInfoWithPhrases <T> banner) where T : BannerPhraseInfo { if (banner == null) { throw new ArgumentNullException("banner"); } var editable = new EditableBannerInfo(); editable.BannerId = banner.BannerId; editable.CampaignId = banner.CampaignId; editable.Title = banner.Title; editable.Text = banner.Text; editable.Href = banner.Href; editable.Geo = banner.Geo; editable.ContactInfo = banner.ContactInfo; //TODO: Copy editable.SiteLinks = banner.SiteLinks; //TODO: Copy editable.MinusKeywords = new List <string>(banner.MinusKeywords); editable.Phrases = banner.Phrases.ToEditable().ToList(); return(editable); }
public int CreateOrUpdateBanner(EditableBannerInfo banner) { if (banner == null) { throw new ArgumentNullException("banner"); } return(banner.BannerId > 0 ? banner.BannerId : 1); }
public int CreateOrUpdateBanner(EditableBannerInfo banner) { if (banner == null) { throw new ArgumentNullException("banner"); } return(CreateOrUpdateBanners(new[] { banner }).FirstOrDefault()); }