Beispiel #1
0
        private static void AddLinkModelToList(LinkModel linkModel, List list)
        {
            if (linkModel != null && linkModel.Url.IsValidUrl())
            {
                if (list.Links == null)
                    list.Links = new List<Link>();

                Link link = linkModel.CreateLink();

                list.Links.Add(link);
            }
        }
Beispiel #2
0
        public static LinkModel CreateLinkModel(this Link link)
        {
            if (link == null)
                return null;

            var linkModel = new LinkModel
                                {
                                    Id = link.Id.ToString(),
                                    Title = link.Text,
                                    Url = link.Url
                                };

            return linkModel;
        }