Esempio n. 1
0
 private void FixStory(BlogStory s)
 {
     //if (s != null)
     //{
     //  s.Body = s.Body.Replace("http://Mannsminds.blob.core.windows.net/img/", "//Mannsminds.blob.core.windows.net/img/");
     //}
 }
Esempio n. 2
0
        private string GetSummary(BlogStory story)
        {
            var           maxparagraphs = 3;
            var           regex         = new Regex("(<p[^>]*>.*?</p>)", RegexOptions.IgnoreCase | RegexOptions.Singleline);
            var           result        = regex.Matches(story.Body);
            StringBuilder bldr          = new StringBuilder();
            var           x             = 0;

            foreach (Match m in result)
            {
                x++;
                bldr.Append(m.Value);
                if (x == maxparagraphs)
                {
                    break;
                }
            }
            return(bldr.ToString());
        }
Esempio n. 3
0
 public void AddStory(BlogStory story)
 {
     _ctx.Stories.Add(story);
 }
Esempio n. 4
0
 public void AddStory(BlogStory story)
 {
     story.Id = Stories.Max(s => s.Id) + 1;
     Stories.Add(story);
 }