Esempio n. 1
0
        protected override IMediaType PerformGet(int id)
        {
            var contentTypes = ContentTypeQueryMapper.GetMediaTypes(
                new[] { id }, Database, SqlSyntax, this);

            var contentType = contentTypes.SingleOrDefault();

            return(contentType);
        }
Esempio n. 2
0
        protected override IContentType PerformGet(int id)
        {
            var contentTypes = ContentTypeQueryMapper.GetContentTypes(
                new[] { id }, Database, SqlSyntax, this, _templateRepository);

            var contentType = contentTypes.SingleOrDefault();

            return(contentType);
        }
        protected override IEnumerable <IMediaType> PerformGetAll(params int[] ids)
        {
            if (ids.Any())
            {
                //NOTE: This logic should never be executed according to our cache policy
                return(ContentTypeQueryMapper.GetMediaTypes(Database, SqlSyntax, this)
                       .Where(x => ids.Contains(x.Id)));
            }

            return(ContentTypeQueryMapper.GetMediaTypes(Database, SqlSyntax, this));
        }
        protected override IEnumerable <IContentType> PerformGetAll(params int[] ids)
        {
            if (ids.Any())
            {
                //NOTE: This logic should never be executed according to our cache policy
                return(ContentTypeQueryMapper.GetContentTypes(Database, SqlSyntax, SupportsPublishing, this, _templateRepository)
                       .Where(x => ids.Contains(x.Id)));
            }

            return(ContentTypeQueryMapper.GetContentTypes(Database, SqlSyntax, SupportsPublishing, this, _templateRepository));
        }
Esempio n. 5
0
 protected override IEnumerable <IContentType> PerformGetAll(params int[] ids)
 {
     if (ids.Any())
     {
         return(ContentTypeQueryMapper.GetContentTypes(ids, Database, SqlSyntax, this, _templateRepository));
     }
     else
     {
         var sql    = new Sql().Select("id").From <NodeDto>().Where <NodeDto>(dto => dto.NodeObjectType == NodeObjectTypeId);
         var allIds = Database.Fetch <int>(sql).ToArray();
         return(ContentTypeQueryMapper.GetContentTypes(allIds, Database, SqlSyntax, this, _templateRepository));
     }
 }