public static AssetsDto FromAssets(IResultList <IEnrichedAssetEntity> assets, Resources resources) { var response = new AssetsDto { Total = assets.Total, Items = assets.Select(x => AssetDto.FromAsset(x, resources)).ToArray() }; return(CreateLinks(response, resources)); }
public static RuleEventsDto FromRuleEvents(IResultList <IRuleEventEntity> ruleEvents, Resources resources) { var result = new RuleEventsDto { Total = ruleEvents.Total, Items = ruleEvents.Select(x => RuleEventDto.FromRuleEvent(x, resources)).ToArray() }; return(result.CreateLinks(resources)); }
public static RuleEventsDto FromRuleEvents(IResultList <IRuleEventEntity> ruleEvents, ApiController controller, string app) { var result = new RuleEventsDto { Total = ruleEvents.Total, Items = ruleEvents.Select(x => RuleEventDto.FromRuleEvent(x, controller, app)).ToArray() }; return(result.CreateLinks(controller, app)); }
public static AssetsDto FromAssets(IResultList <IEnrichedAssetEntity> assets, ApiController controller, string app) { var response = new AssetsDto { Total = assets.Total, Items = assets.Select(x => AssetDto.FromAsset(x, controller, app)).ToArray() }; return(CreateLinks(response, controller, app)); }
public static AssetFoldersDto FromAssets(IResultList <IAssetFolderEntity> assetFolders, IEnumerable <IAssetFolderEntity> path, Resources resources) { var response = new AssetFoldersDto { Total = assetFolders.Total, Items = assetFolders.Select(x => AssetFolderDto.FromAssetFolder(x, resources)).ToArray() }; response.Path = path.Select(x => AssetFolderDto.FromAssetFolder(x, resources)).ToArray(); return(CreateLinks(response, resources)); }
public static async Task <ContentsDto> FromContentsAsync(IResultList <IEnrichedContentEntity> contents, Context context, ApiController controller, ISchemaEntity schema, IContentWorkflow workflow) { var result = new ContentsDto { Total = contents.Total, Items = contents.Select(x => ContentDto.FromContent(context, x, controller)).ToArray() }; await result.AssignStatusesAsync(workflow, schema); return(result.CreateLinks(controller, schema.AppId.Name, schema.SchemaDef.Name)); }
public static async Task <ContentsDto> FromContentsAsync(IResultList <IEnrichedContentEntity> contents, Resources resources, ISchemaEntity?schema, IContentWorkflow workflow) { var result = new ContentsDto { Total = contents.Total, Items = contents.Select(x => ContentDto.FromContent(x, resources)).ToArray() }; if (schema != null) { await result.AssignStatusesAsync(workflow, schema); result.CreateLinks(resources, schema.SchemaDef.Name); } return(result); }
public static AssetsDto FromAssets(IResultList <IAssetEntity> assets) { return(new AssetsDto { Total = assets.Total, Items = assets.Select(AssetDto.FromAsset).ToArray() }); }