public override IList <Tag> GetList(bool includeRelatedEntities = true)
        {
            var tagList = EntityCache.Get <List <Tag> >(TagListKey);

            if (tagList == null)
            {
                var tags = Context.Tags.AsQueryable();
                if (includeRelatedEntities)
                {
                    tags = tags
                           .Include(t => t.Posts);
                }
                tagList = tags
                          .OrderBy(t => t.Name)
                          .ToList();
                EntityCache.Add(TagListKey, tagList);
            }
            return(tagList);
        }
        public override IList <Technology> GetList(bool includeRelatedEntities = true)
        {
            var technologyList = EntityCache.Get <List <Technology> >(TechnologyListKey);

            if (technologyList == null)
            {
                var technologies = Context.Technologies.AsQueryable();
                if (includeRelatedEntities)
                {
                    technologies = technologies
                                   .Include(t => t.Resources);
                }
                technologyList = technologies
                                 .OrderBy(t => t.Name)
                                 .ToList();
                EntityCache.Add(TechnologyListKey, technologyList);
            }
            return(technologyList);
        }
Example #3
0
        public override IList <Section> GetList(bool includeRelatedEntities = true)
        {
            var sectionsList = EntityCache.Get <List <Section> >(SectionsListKey);

            if (sectionsList == null)
            {
                var sections = Context.Sections.AsQueryable();
                if (includeRelatedEntities)
                {
                    sections = sections
                               .Include(s => s.Resources);
                }
                sectionsList = sections
                               .OrderBy(s => s.Name)
                               .ToList();
                EntityCache.Add(SectionsListKey, sectionsList);
            }
            return(sectionsList);
        }
        public override IList <Post> GetList(bool includeRelatedEntities = true)
        {
            var postList = EntityCache.Get <List <Post> >(PostListKey);

            if (postList == null)
            {
                var posts = Context.Posts.AsQueryable();
                if (includeRelatedEntities)
                {
                    posts = posts
                            .Include(p => p.PostCategory)
                            .Include(p => p.Tags.Select(t => t.Tag));
                }
                postList = posts
                           .OrderBy(p => p.PostedOn)
                           .ToList();
                EntityCache.Add(PostListKey, postList);
            }
            return(postList);
        }
Example #5
0
        public override IList <Resource> GetList(bool includeRelatedEntities = true)
        {
            var resourceList = EntityCache.Get <List <Resource> >(ResourceListKey);

            if (resourceList == null)
            {
                var resources = Context.Resources.AsQueryable();
                if (includeRelatedEntities)
                {
                    resources = resources
                                .Include(r => r.Section)
                                .Include(r => r.Category);
                }
                resourceList = resources
                               .OrderBy(s => s.Name)
                               .ToList();
                EntityCache.Add(ResourceListKey, resourceList);
            }
            return(resourceList);
        }
Example #6
0
        public override IList <Category> GetList(bool includeRelatedEntities = true)
        {
            var categoryList = EntityCache.Get <List <Category> >(CategoryListKey);

            if (categoryList == null)
            {
                var category = Context.Categories.AsQueryable();

                if (includeRelatedEntities)
                {
                    category = category
                               .Include(c => c.Resources);
                }
                categoryList = category
                               .OrderBy(c => c.Name)
                               .ToList();
                EntityCache.Add(CategoryListKey, categoryList);
            }
            return(categoryList);
        }
 public override void Add(Technology entity)
 {
     base.Add(entity);
     EntityCache.Remove(TechnologyListKey);
 }
Example #8
0
 public override void Update(Resource entity)
 {
     base.Update(entity);
     EntityCache.Remove(ResourceListKey);
 }
Example #9
0
 public override void Delete(int id)
 {
     base.Delete(id);
     EntityCache.Remove(CategoryListKey);
 }
Example #10
0
 public override void Update(Category entity)
 {
     base.Update(entity);
     EntityCache.Remove(CategoryListKey);
 }
Example #11
0
 public override void Add(Category entity)
 {
     base.Add(entity);
     EntityCache.Remove(CategoryListKey);
 }
Example #12
0
 public override void Delete(int id)
 {
     base.Delete(id);
     EntityCache.Remove(SectionsListKey);
 }
Example #13
0
 public override void Add(Resource entity)
 {
     base.Add(entity);
     EntityCache.Remove(ResourceListKey);
 }
Example #14
0
 public override void Update(Section entity)
 {
     base.Update(entity);
     EntityCache.Remove(SectionsListKey);
 }
 public override void Update(Technology entity)
 {
     base.Update(entity);
     EntityCache.Remove(TechnologyListKey);
 }
 public override void Update(Tag entity)
 {
     base.Update(entity);
     EntityCache.Remove(TagListKey);
 }
 public override void Add(Tag entity)
 {
     base.Add(entity);
     EntityCache.Remove(TagListKey);
 }
Example #18
0
 public override void Delete(int id)
 {
     base.Delete(id);
     EntityCache.Remove(ResourceListKey);
 }
 public override void Add(Post entity)
 {
     base.Add(entity);
     EntityCache.Remove(PostListKey);
 }
 public override void Delete(int id)
 {
     base.Delete(id);
     EntityCache.Remove(TechnologyListKey);
 }
Example #21
0
 public override void Add(Section entity)
 {
     base.Add(entity);
     EntityCache.Remove(SectionsListKey);
 }