GetEntities() public method

public GetEntities ( ) : IEntity>.IDictionary
return IEntity>.IDictionary
Esempio n. 1
0
        public dynamic GetContentInfo(int appId, int zoneId, string scope)
        {
            var appWrapper = new SxcAppWrapper(appId);

            var contentTypes = appWrapper.GetContentTypes(scope);
            var entities     = appWrapper.GetEntities();
            var templates    = appWrapper.GetTemplates();
            var dimensions   = new string[] { appWrapper.GetCultureCode() };

            return(new
            {
                ContentTypes = contentTypes.Select(c => new
                {
                    Id = c.AttributeSetId,
                    Name = c.Name,
                    StaticName = c.StaticName,
                    Templates = templates.Where(t => t.ContentTypeStaticName == c.StaticName).Select(t => new
                    {
                        Id = t.TemplateId,
                        Name = t.Name
                    }),
                    Entities = entities.Where(e => e.Value.Type.AttributeSetId == c.AttributeSetId).Select(e => new DynamicEntity(e.Value, dimensions, null).ToDictionary())
                }),
                TemplatesWithoutContentTypes = templates.Where(t => !string.IsNullOrEmpty(t.ContentTypeStaticName)).Select(t => new
                {
                    Id = t.TemplateId,
                    Name = t.Name
                })
            });
        }
Esempio n. 2
0
        public dynamic GetAppInfo(int appId, int zoneId)
        {
            var appWrapper = new SxcAppWrapper(appId);
            var zipExport  = new ZipExport(zoneId, appId);

            return(new
            {
                Name = appWrapper.App.Name,
                Guid = appWrapper.App.AppGuid,
                Version = appWrapper.GetVersion(),
                EntitiesCount = appWrapper.GetEntities().Count(),
                LanguagesCount = appWrapper.GetActiveLanguages().Count(),
                TemplatesCount = appWrapper.GetTemplates().Count(),
                HasRazorTemplates = appWrapper.GetRazorTemplates().Count() > 0,
                HasTokenTemplates = appWrapper.GetTokenTemplates().Count() > 0,
                FilesCount = zipExport.FileManager.AllFiles.Count(),
                TransferableFilesCount = zipExport.FileManager.AllTransferableFiles.Count()
            });
        }