Ejemplo n.º 1
0
        public static List<StoriesHistoryModel> GetModels(string tag)
        {
            List<StoriesHistoryModel> ret = new List<StoriesHistoryModel>();

            using (var ctx = new Entities())
            {
                var list = ctx.GetRequirementHistory(tag, null).ToList();
                string previous = string.Empty, text;

                foreach (var i in list)
                {
                    text = String.Format("<p><strong>{0}</strong></p>{1}", i.Title, i.Text);
                    ret.Add(new StoriesHistoryModel(i, HtmlDiff.Execute(previous, text)));
                    previous = text;
                }
            }

            return (from i in ret orderby i.RevisionNumber descending select i).ToList();
        }