public static CollectionBase <ArticleBase> GetList(int count, string type, IArticleRepository rep) { var articleBases = new CollectionBase <ArticleBase>(); articleBases.AddRange(rep.FetchList(count, type).Select(article => ((ArticleBase)Reflector.CreateObject(article.ArticleType.Assembly, article.ArticleType.Class)). Desrialize(article.Content.ToString()))); articleBases.ForEach(ab => ab.MarkOld()); return(articleBases); }
public static CollectionBase <ArticleBase> Search(string search, IArticleRepository rep) { search = search.ToLower(); var articleBases = new CollectionBase <ArticleBase>(); articleBases.AddRange(rep.Search(search).Select(article => ((ArticleBase)Reflector.CreateObject(article.ArticleType.Assembly, article.ArticleType.Class)). Desrialize(article.Content.ToString()))); articleBases.ForEach(ab => ab.MarkOld()); return(articleBases); }
public static CollectionBase <BulletinBase> GetAll(ILookupRepository lRep, IBulletinRepository bRep) { var bulletins = new CollectionBase <BulletinBase>(); bulletins.AddRange(bRep.FetchList().Select(bulletin => ((BulletinBase)Reflector.CreateObject(bulletin.BulletinType.Assembly, bulletin.BulletinType.Class, new[] { bulletin })). Desrialize(bulletin.Content.ToString()))); bulletins.ForEach(b => { b.MarkOld(); b.LoadCategoryInfo(lRep); }); return(bulletins); }