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/"); //} }
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()); }
public void AddStory(BlogStory story) { _ctx.Stories.Add(story); }
public void AddStory(BlogStory story) { story.Id = Stories.Max(s => s.Id) + 1; Stories.Add(story); }