Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide null type content #56

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,21 @@ public class ContentTypeService
{
private readonly IContentTypeRepository _contentTypeRepository;
private readonly ContentTypeUsagesRepository _contentTypeUsagesRepository;
private readonly ContentTypeBaseService _contentTypeBaseService;


public ContentTypeService(IContentTypeRepository contentTypeRepository, ContentTypeUsagesRepository contentTypeUsagesRepository)
public ContentTypeService(IContentTypeRepository contentTypeRepository, ContentTypeBaseService contentTypeBaseService, ContentTypeUsagesRepository contentTypeUsagesRepository)
{
_contentTypeRepository = contentTypeRepository;
_contentTypeBaseService = contentTypeBaseService;
_contentTypeUsagesRepository = contentTypeUsagesRepository;
}

public IEnumerable<ContentType> GetAll(ContentTypesFilterCriteria? filterCriteria)
{
var contentTypes = _contentTypeRepository.List();
var contentTypeBases = _contentTypeBaseService.GetAll();

var contentTypes = _contentTypeRepository.List()
.Where(type => contentTypeBases.Any(ctb => ctb == type.Base));

if (filterCriteria != null)
{
Expand Down