Browse Source

Tests fixed and renaming reverted.

pull/377/head
Sebastian Stehle 7 years ago
parent
commit
e113be7761
  1. 4
      src/Squidex.Domain.Apps.Entities/Assets/AssetCommandMiddleware.cs
  2. 4
      src/Squidex.Domain.Apps.Entities/Assets/AssetCreatedResult.cs
  3. 6
      src/Squidex.Domain.Apps.Entities/Assets/AssetEnricher.cs
  4. 2
      src/Squidex.Domain.Apps.Entities/Assets/AssetEntity.cs
  5. 6
      src/Squidex.Domain.Apps.Entities/Assets/AssetQueryService.cs
  6. 4
      src/Squidex.Domain.Apps.Entities/Assets/IAssetEnricher.cs
  7. 6
      src/Squidex.Domain.Apps.Entities/Assets/IAssetQueryService.cs
  8. 2
      src/Squidex.Domain.Apps.Entities/Assets/IEnrichedAssetEntity.cs
  9. 2
      src/Squidex.Domain.Apps.Entities/Contents/ContentCommandMiddleware.cs
  10. 4
      src/Squidex.Domain.Apps.Entities/Contents/ContentEnricher.cs
  11. 2
      src/Squidex.Domain.Apps.Entities/Contents/ContentEntity.cs
  12. 18
      src/Squidex.Domain.Apps.Entities/Contents/ContentQueryService.cs
  13. 10
      src/Squidex.Domain.Apps.Entities/Contents/GraphQL/GraphQLExecutionContext.cs
  14. 6
      src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/AssetGraphType.cs
  15. 6
      src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ContentGraphType.cs
  16. 4
      src/Squidex.Domain.Apps.Entities/Contents/IContentEnricher.cs
  17. 6
      src/Squidex.Domain.Apps.Entities/Contents/IContentQueryService.cs
  18. 2
      src/Squidex.Domain.Apps.Entities/Contents/IEnrichedContentEntity.cs
  19. 6
      src/Squidex.Domain.Apps.Entities/Contents/QueryExecutionContext.cs
  20. 2
      src/Squidex/Areas/Api/Controllers/Assets/AssetsController.cs
  21. 2
      src/Squidex/Areas/Api/Controllers/Assets/Models/AssetDto.cs
  22. 2
      src/Squidex/Areas/Api/Controllers/Assets/Models/AssetsDto.cs
  23. 2
      src/Squidex/Areas/Api/Controllers/Contents/ContentsController.cs
  24. 4
      src/Squidex/Areas/Api/Controllers/Contents/Models/ContentDto.cs
  25. 2
      src/Squidex/Areas/Api/Controllers/Contents/Models/ContentsDto.cs
  26. 79
      tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetCommandMiddlewareTests.cs
  27. 6
      tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetQueryServiceTests.cs
  28. 33
      tests/Squidex.Domain.Apps.Entities.Tests/Contents/ContentCommandMiddlewareTests.cs
  29. 2
      tests/Squidex.Domain.Apps.Entities.Tests/Contents/ContentQueryServiceTests.cs
  30. 4
      tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLTestBase.cs

4
src/Squidex.Domain.Apps.Entities/Assets/AssetCommandMiddleware.cs

@ -85,7 +85,7 @@ namespace Squidex.Domain.Apps.Entities.Assets
await HandleCoreAsync(context, next); await HandleCoreAsync(context, next);
var asset = context.PlainResult as IAssetEntityEnriched; var asset = context.PlainResult as IEnrichedAssetEntity;
context.Complete(new AssetCreatedResult(asset, false)); context.Complete(new AssetCreatedResult(asset, false));
@ -131,7 +131,7 @@ namespace Squidex.Domain.Apps.Entities.Assets
{ {
await base.HandleAsync(context, next); await base.HandleAsync(context, next);
if (context.PlainResult is IAssetEntity asset && !(context.PlainResult is IAssetEntityEnriched)) if (context.PlainResult is IAssetEntity asset && !(context.PlainResult is IEnrichedAssetEntity))
{ {
var enriched = await assetEnricher.EnrichAsync(asset); var enriched = await assetEnricher.EnrichAsync(asset);

4
src/Squidex.Domain.Apps.Entities/Assets/AssetCreatedResult.cs

@ -9,11 +9,11 @@ namespace Squidex.Domain.Apps.Entities.Assets
{ {
public sealed class AssetCreatedResult public sealed class AssetCreatedResult
{ {
public IAssetEntityEnriched Asset { get; } public IEnrichedAssetEntity Asset { get; }
public bool IsDuplicate { get; } public bool IsDuplicate { get; }
public AssetCreatedResult(IAssetEntityEnriched asset, bool isDuplicate) public AssetCreatedResult(IEnrichedAssetEntity asset, bool isDuplicate)
{ {
Asset = asset; Asset = asset;

6
src/Squidex.Domain.Apps.Entities/Assets/AssetEnricher.cs

@ -26,7 +26,7 @@ namespace Squidex.Domain.Apps.Entities.Assets
this.tagService = tagService; this.tagService = tagService;
} }
public async Task<IAssetEntityEnriched> EnrichAsync(IAssetEntity asset) public async Task<IEnrichedAssetEntity> EnrichAsync(IAssetEntity asset)
{ {
Guard.NotNull(asset, nameof(asset)); Guard.NotNull(asset, nameof(asset));
@ -35,13 +35,13 @@ namespace Squidex.Domain.Apps.Entities.Assets
return enriched[0]; return enriched[0];
} }
public async Task<IReadOnlyList<IAssetEntityEnriched>> EnrichAsync(IEnumerable<IAssetEntity> assets) public async Task<IReadOnlyList<IEnrichedAssetEntity>> EnrichAsync(IEnumerable<IAssetEntity> assets)
{ {
Guard.NotNull(assets, nameof(assets)); Guard.NotNull(assets, nameof(assets));
using (Profiler.TraceMethod<AssetEnricher>()) using (Profiler.TraceMethod<AssetEnricher>())
{ {
var results = new List<IAssetEntityEnriched>(); var results = new List<IEnrichedAssetEntity>();
foreach (var group in assets.GroupBy(x => x.AppId.Id)) foreach (var group in assets.GroupBy(x => x.AppId.Id))
{ {

2
src/Squidex.Domain.Apps.Entities/Assets/AssetEntity.cs

@ -12,7 +12,7 @@ using Squidex.Infrastructure;
namespace Squidex.Domain.Apps.Entities.Assets namespace Squidex.Domain.Apps.Entities.Assets
{ {
public sealed class AssetEntity : IAssetEntityEnriched public sealed class AssetEntity : IEnrichedAssetEntity
{ {
public NamedId<Guid> AppId { get; set; } public NamedId<Guid> AppId { get; set; }

6
src/Squidex.Domain.Apps.Entities/Assets/AssetQueryService.cs

@ -49,7 +49,7 @@ namespace Squidex.Domain.Apps.Entities.Assets
this.options = options.Value; this.options = options.Value;
} }
public async Task<IAssetEntityEnriched> FindAssetAsync( Guid id) public async Task<IEnrichedAssetEntity> FindAssetAsync( Guid id)
{ {
var asset = await assetRepository.FindAssetAsync(id); var asset = await assetRepository.FindAssetAsync(id);
@ -61,7 +61,7 @@ namespace Squidex.Domain.Apps.Entities.Assets
return null; return null;
} }
public async Task<IReadOnlyList<IAssetEntityEnriched>> QueryByHashAsync(Guid appId, string hash) public async Task<IReadOnlyList<IEnrichedAssetEntity>> QueryByHashAsync(Guid appId, string hash)
{ {
Guard.NotNull(hash, nameof(hash)); Guard.NotNull(hash, nameof(hash));
@ -70,7 +70,7 @@ namespace Squidex.Domain.Apps.Entities.Assets
return await assetEnricher.EnrichAsync(assets); return await assetEnricher.EnrichAsync(assets);
} }
public async Task<IResultList<IAssetEntityEnriched>> QueryAsync(QueryContext context, Q query) public async Task<IResultList<IEnrichedAssetEntity>> QueryAsync(QueryContext context, Q query)
{ {
Guard.NotNull(context, nameof(context)); Guard.NotNull(context, nameof(context));
Guard.NotNull(query, nameof(query)); Guard.NotNull(query, nameof(query));

4
src/Squidex.Domain.Apps.Entities/Assets/IAssetEnricher.cs

@ -12,8 +12,8 @@ namespace Squidex.Domain.Apps.Entities.Assets
{ {
public interface IAssetEnricher public interface IAssetEnricher
{ {
Task<IAssetEntityEnriched> EnrichAsync(IAssetEntity asset); Task<IEnrichedAssetEntity> EnrichAsync(IAssetEntity asset);
Task<IReadOnlyList<IAssetEntityEnriched>> EnrichAsync(IEnumerable<IAssetEntity> assets); Task<IReadOnlyList<IEnrichedAssetEntity>> EnrichAsync(IEnumerable<IAssetEntity> assets);
} }
} }

6
src/Squidex.Domain.Apps.Entities/Assets/IAssetQueryService.cs

@ -16,10 +16,10 @@ namespace Squidex.Domain.Apps.Entities.Assets
{ {
int DefaultPageSizeGraphQl { get; } int DefaultPageSizeGraphQl { get; }
Task<IReadOnlyList<IAssetEntityEnriched>> QueryByHashAsync(Guid appId, string hash); Task<IReadOnlyList<IEnrichedAssetEntity>> QueryByHashAsync(Guid appId, string hash);
Task<IResultList<IAssetEntityEnriched>> QueryAsync(QueryContext contex, Q query); Task<IResultList<IEnrichedAssetEntity>> QueryAsync(QueryContext contex, Q query);
Task<IAssetEntityEnriched> FindAssetAsync(Guid id); Task<IEnrichedAssetEntity> FindAssetAsync(Guid id);
} }
} }

2
src/Squidex.Domain.Apps.Entities/Assets/IAssetEntityEnriched.cs → src/Squidex.Domain.Apps.Entities/Assets/IEnrichedAssetEntity.cs

@ -9,7 +9,7 @@ using System.Collections.Generic;
namespace Squidex.Domain.Apps.Entities.Assets namespace Squidex.Domain.Apps.Entities.Assets
{ {
public interface IAssetEntityEnriched : IAssetEntity public interface IEnrichedAssetEntity : IAssetEntity
{ {
HashSet<string> TagNames { get; } HashSet<string> TagNames { get; }
} }

2
src/Squidex.Domain.Apps.Entities/Contents/ContentCommandMiddleware.cs

@ -30,7 +30,7 @@ namespace Squidex.Domain.Apps.Entities.Contents
{ {
await base.HandleAsync(context, next); await base.HandleAsync(context, next);
if (context.PlainResult is IContentEntity content) if (context.PlainResult is IContentEntity content && !(context.PlainResult is IEnrichedContentEntity))
{ {
var enriched = await contentEnricher.EnrichAsync(content); var enriched = await contentEnricher.EnrichAsync(content);

4
src/Squidex.Domain.Apps.Entities/Contents/ContentEnricher.cs

@ -26,7 +26,7 @@ namespace Squidex.Domain.Apps.Entities.Contents
this.contentWorkflow = contentWorkflow; this.contentWorkflow = contentWorkflow;
} }
public async Task<IContentEntityEnriched> EnrichAsync(IContentEntity content) public async Task<IEnrichedContentEntity> EnrichAsync(IContentEntity content)
{ {
Guard.NotNull(content, nameof(content)); Guard.NotNull(content, nameof(content));
@ -35,7 +35,7 @@ namespace Squidex.Domain.Apps.Entities.Contents
return enriched[0]; return enriched[0];
} }
public async Task<IReadOnlyList<IContentEntityEnriched>> EnrichAsync(IEnumerable<IContentEntity> contents) public async Task<IReadOnlyList<IEnrichedContentEntity>> EnrichAsync(IEnumerable<IContentEntity> contents)
{ {
Guard.NotNull(contents, nameof(contents)); Guard.NotNull(contents, nameof(contents));

2
src/Squidex.Domain.Apps.Entities/Contents/ContentEntity.cs

@ -12,7 +12,7 @@ using Squidex.Infrastructure;
namespace Squidex.Domain.Apps.Entities.Contents namespace Squidex.Domain.Apps.Entities.Contents
{ {
public sealed class ContentEntity : IContentEntityEnriched public sealed class ContentEntity : IEnrichedContentEntity
{ {
public Guid Id { get; set; } public Guid Id { get; set; }

18
src/Squidex.Domain.Apps.Entities/Contents/ContentQueryService.cs

@ -34,7 +34,7 @@ namespace Squidex.Domain.Apps.Entities.Contents
public sealed class ContentQueryService : IContentQueryService public sealed class ContentQueryService : IContentQueryService
{ {
private static readonly Status[] StatusPublishedOnly = { Status.Published }; private static readonly Status[] StatusPublishedOnly = { Status.Published };
private static readonly IResultList<IContentEntityEnriched> EmptyContents = ResultList.CreateFrom<IContentEntityEnriched>(0); private static readonly IResultList<IEnrichedContentEntity> EmptyContents = ResultList.CreateFrom<IEnrichedContentEntity>(0);
private readonly IAppProvider appProvider; private readonly IAppProvider appProvider;
private readonly IAssetUrlGenerator assetUrlGenerator; private readonly IAssetUrlGenerator assetUrlGenerator;
private readonly IContentEnricher contentEnricher; private readonly IContentEnricher contentEnricher;
@ -78,7 +78,7 @@ namespace Squidex.Domain.Apps.Entities.Contents
this.scriptEngine = scriptEngine; this.scriptEngine = scriptEngine;
} }
public async Task<IContentEntityEnriched> FindContentAsync(QueryContext context, string schemaIdOrName, Guid id, long version = -1) public async Task<IEnrichedContentEntity> FindContentAsync(QueryContext context, string schemaIdOrName, Guid id, long version = -1)
{ {
Guard.NotNull(context, nameof(context)); Guard.NotNull(context, nameof(context));
@ -108,7 +108,7 @@ namespace Squidex.Domain.Apps.Entities.Contents
} }
} }
public async Task<IResultList<IContentEntityEnriched>> QueryAsync(QueryContext context, string schemaIdOrName, Q query) public async Task<IResultList<IEnrichedContentEntity>> QueryAsync(QueryContext context, string schemaIdOrName, Q query)
{ {
Guard.NotNull(context, nameof(context)); Guard.NotNull(context, nameof(context));
@ -133,7 +133,7 @@ namespace Squidex.Domain.Apps.Entities.Contents
} }
} }
public async Task<IResultList<IContentEntityEnriched>> QueryAsync(QueryContext context, IReadOnlyList<Guid> ids) public async Task<IResultList<IEnrichedContentEntity>> QueryAsync(QueryContext context, IReadOnlyList<Guid> ids)
{ {
Guard.NotNull(context, nameof(context)); Guard.NotNull(context, nameof(context));
@ -144,7 +144,7 @@ namespace Squidex.Domain.Apps.Entities.Contents
return EmptyContents; return EmptyContents;
} }
var results = new List<IContentEntityEnriched>(); var results = new List<IEnrichedContentEntity>();
var contents = await QueryCoreAsync(context, ids); var contents = await QueryCoreAsync(context, ids);
@ -166,25 +166,25 @@ namespace Squidex.Domain.Apps.Entities.Contents
} }
} }
private async Task<IResultList<IContentEntityEnriched>> TransformAsync(QueryContext context, ISchemaEntity schema, IResultList<IContentEntity> contents) private async Task<IResultList<IEnrichedContentEntity>> TransformAsync(QueryContext context, ISchemaEntity schema, IResultList<IContentEntity> contents)
{ {
var transformed = await TransformCoreAsync(context, schema, contents); var transformed = await TransformCoreAsync(context, schema, contents);
return ResultList.Create(contents.Total, transformed); return ResultList.Create(contents.Total, transformed);
} }
private async Task<IContentEntityEnriched> TransformAsync(QueryContext context, ISchemaEntity schema, IContentEntity content) private async Task<IEnrichedContentEntity> TransformAsync(QueryContext context, ISchemaEntity schema, IContentEntity content)
{ {
var transformed = await TransformCoreAsync(context, schema, Enumerable.Repeat(content, 1)); var transformed = await TransformCoreAsync(context, schema, Enumerable.Repeat(content, 1));
return transformed[0]; return transformed[0];
} }
private async Task<IReadOnlyList<IContentEntityEnriched>> TransformCoreAsync(QueryContext context, ISchemaEntity schema, IEnumerable<IContentEntity> contents) private async Task<IReadOnlyList<IEnrichedContentEntity>> TransformCoreAsync(QueryContext context, ISchemaEntity schema, IEnumerable<IContentEntity> contents)
{ {
using (Profiler.TraceMethod<ContentQueryService>()) using (Profiler.TraceMethod<ContentQueryService>())
{ {
var results = new List<IContentEntityEnriched>(); var results = new List<IEnrichedContentEntity>();
var converters = GenerateConverters(context).ToArray(); var converters = GenerateConverters(context).ToArray();

10
src/Squidex.Domain.Apps.Entities/Contents/GraphQL/GraphQLExecutionContext.cs

@ -20,7 +20,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL
{ {
public sealed class GraphQLExecutionContext : QueryExecutionContext public sealed class GraphQLExecutionContext : QueryExecutionContext
{ {
private static readonly List<IAssetEntityEnriched> EmptyAssets = new List<IAssetEntityEnriched>(); private static readonly List<IEnrichedAssetEntity> EmptyAssets = new List<IEnrichedAssetEntity>();
private static readonly List<IContentEntity> EmptyContents = new List<IContentEntity>(); private static readonly List<IContentEntity> EmptyContents = new List<IContentEntity>();
private readonly IDataLoaderContextAccessor dataLoaderContextAccessor; private readonly IDataLoaderContextAccessor dataLoaderContextAccessor;
private readonly IDependencyResolver resolver; private readonly IDependencyResolver resolver;
@ -53,7 +53,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL
execution.UserContext = this; execution.UserContext = this;
} }
public override Task<IAssetEntityEnriched> FindAssetAsync(Guid id) public override Task<IEnrichedAssetEntity> FindAssetAsync(Guid id)
{ {
var dataLoader = GetAssetsLoader(); var dataLoader = GetAssetsLoader();
@ -67,7 +67,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL
return dataLoader.LoadAsync(id); return dataLoader.LoadAsync(id);
} }
public async Task<IReadOnlyList<IAssetEntityEnriched>> GetReferencedAssetsAsync(IJsonValue value) public async Task<IReadOnlyList<IEnrichedAssetEntity>> GetReferencedAssetsAsync(IJsonValue value)
{ {
var ids = ParseIds(value); var ids = ParseIds(value);
@ -95,9 +95,9 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL
return await dataLoader.LoadManyAsync(ids); return await dataLoader.LoadManyAsync(ids);
} }
private IDataLoader<Guid, IAssetEntityEnriched> GetAssetsLoader() private IDataLoader<Guid, IEnrichedAssetEntity> GetAssetsLoader()
{ {
return dataLoaderContextAccessor.Context.GetOrAddBatchLoader<Guid, IAssetEntityEnriched>("Assets", return dataLoaderContextAccessor.Context.GetOrAddBatchLoader<Guid, IEnrichedAssetEntity>("Assets",
async batch => async batch =>
{ {
var result = await GetReferencedAssetsAsync(new List<Guid>(batch)); var result = await GetReferencedAssetsAsync(new List<Guid>(batch));

6
src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/AssetGraphType.cs

@ -13,7 +13,7 @@ using Squidex.Infrastructure;
namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types
{ {
public sealed class AssetGraphType : ObjectGraphType<IAssetEntityEnriched> public sealed class AssetGraphType : ObjectGraphType<IEnrichedAssetEntity>
{ {
public AssetGraphType(IGraphModel model) public AssetGraphType(IGraphModel model)
{ {
@ -186,9 +186,9 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types
Description = "An asset"; Description = "An asset";
} }
private static IFieldResolver Resolve(Func<IAssetEntityEnriched, object> action) private static IFieldResolver Resolve(Func<IEnrichedAssetEntity, object> action)
{ {
return new FuncFieldResolver<IAssetEntityEnriched, object>(c => action(c.Source)); return new FuncFieldResolver<IEnrichedAssetEntity, object>(c => action(c.Source));
} }
} }
} }

6
src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ContentGraphType.cs

@ -13,7 +13,7 @@ using Squidex.Domain.Apps.Entities.Schemas;
namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types
{ {
public sealed class ContentGraphType : ObjectGraphType<IContentEntityEnriched> public sealed class ContentGraphType : ObjectGraphType<IEnrichedContentEntity>
{ {
public void Initialize(IGraphModel model, ISchemaEntity schema, IComplexGraphType contentDataType) public void Initialize(IGraphModel model, ISchemaEntity schema, IComplexGraphType contentDataType)
{ {
@ -116,9 +116,9 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types
Description = $"The structure of a {schemaName} content type."; Description = $"The structure of a {schemaName} content type.";
} }
private static IFieldResolver Resolve(Func<IContentEntityEnriched, object> action) private static IFieldResolver Resolve(Func<IEnrichedContentEntity, object> action)
{ {
return new FuncFieldResolver<IContentEntityEnriched, object>(c => action(c.Source)); return new FuncFieldResolver<IEnrichedContentEntity, object>(c => action(c.Source));
} }
} }
} }

4
src/Squidex.Domain.Apps.Entities/Contents/IContentEnricher.cs

@ -12,8 +12,8 @@ namespace Squidex.Domain.Apps.Entities.Contents
{ {
public interface IContentEnricher public interface IContentEnricher
{ {
Task<IContentEntityEnriched> EnrichAsync(IContentEntity content); Task<IEnrichedContentEntity> EnrichAsync(IContentEntity content);
Task<IReadOnlyList<IContentEntityEnriched>> EnrichAsync(IEnumerable<IContentEntity> contents); Task<IReadOnlyList<IEnrichedContentEntity>> EnrichAsync(IEnumerable<IContentEntity> contents);
} }
} }

6
src/Squidex.Domain.Apps.Entities/Contents/IContentQueryService.cs

@ -17,11 +17,11 @@ namespace Squidex.Domain.Apps.Entities.Contents
{ {
int DefaultPageSizeGraphQl { get; } int DefaultPageSizeGraphQl { get; }
Task<IResultList<IContentEntityEnriched>> QueryAsync(QueryContext context, IReadOnlyList<Guid> ids); Task<IResultList<IEnrichedContentEntity>> QueryAsync(QueryContext context, IReadOnlyList<Guid> ids);
Task<IResultList<IContentEntityEnriched>> QueryAsync(QueryContext context, string schemaIdOrName, Q query); Task<IResultList<IEnrichedContentEntity>> QueryAsync(QueryContext context, string schemaIdOrName, Q query);
Task<IContentEntityEnriched> FindContentAsync(QueryContext context, string schemaIdOrName, Guid id, long version = EtagVersion.Any); Task<IEnrichedContentEntity> FindContentAsync(QueryContext context, string schemaIdOrName, Guid id, long version = EtagVersion.Any);
Task<ISchemaEntity> GetSchemaOrThrowAsync(QueryContext context, string schemaIdOrName); Task<ISchemaEntity> GetSchemaOrThrowAsync(QueryContext context, string schemaIdOrName);
} }

2
src/Squidex.Domain.Apps.Entities/Contents/IContentEntityEnriched.cs → src/Squidex.Domain.Apps.Entities/Contents/IEnrichedContentEntity.cs

@ -9,7 +9,7 @@ using Squidex.Domain.Apps.Core.Contents;
namespace Squidex.Domain.Apps.Entities.Contents namespace Squidex.Domain.Apps.Entities.Contents
{ {
public interface IContentEntityEnriched : IContentEntity public interface IEnrichedContentEntity : IContentEntity
{ {
bool CanUpdate { get; } bool CanUpdate { get; }

6
src/Squidex.Domain.Apps.Entities/Contents/QueryExecutionContext.cs

@ -18,7 +18,7 @@ namespace Squidex.Domain.Apps.Entities.Contents
public class QueryExecutionContext public class QueryExecutionContext
{ {
private readonly ConcurrentDictionary<Guid, IContentEntity> cachedContents = new ConcurrentDictionary<Guid, IContentEntity>(); private readonly ConcurrentDictionary<Guid, IContentEntity> cachedContents = new ConcurrentDictionary<Guid, IContentEntity>();
private readonly ConcurrentDictionary<Guid, IAssetEntityEnriched> cachedAssets = new ConcurrentDictionary<Guid, IAssetEntityEnriched>(); private readonly ConcurrentDictionary<Guid, IEnrichedAssetEntity> cachedAssets = new ConcurrentDictionary<Guid, IEnrichedAssetEntity>();
private readonly IContentQueryService contentQuery; private readonly IContentQueryService contentQuery;
private readonly IAssetQueryService assetQuery; private readonly IAssetQueryService assetQuery;
private readonly QueryContext context; private readonly QueryContext context;
@ -34,7 +34,7 @@ namespace Squidex.Domain.Apps.Entities.Contents
this.context = context; this.context = context;
} }
public virtual async Task<IAssetEntityEnriched> FindAssetAsync(Guid id) public virtual async Task<IEnrichedAssetEntity> FindAssetAsync(Guid id)
{ {
var asset = cachedAssets.GetOrDefault(id); var asset = cachedAssets.GetOrDefault(id);
@ -92,7 +92,7 @@ namespace Squidex.Domain.Apps.Entities.Contents
return result; return result;
} }
public virtual async Task<IReadOnlyList<IAssetEntityEnriched>> GetReferencedAssetsAsync(ICollection<Guid> ids) public virtual async Task<IReadOnlyList<IEnrichedAssetEntity>> GetReferencedAssetsAsync(ICollection<Guid> ids)
{ {
Guard.NotNull(ids, nameof(ids)); Guard.NotNull(ids, nameof(ids));

2
src/Squidex/Areas/Api/Controllers/Assets/AssetsController.cs

@ -265,7 +265,7 @@ namespace Squidex.Areas.Api.Controllers.Assets
{ {
var context = await CommandBus.PublishAsync(command); var context = await CommandBus.PublishAsync(command);
var result = context.Result<IAssetEntityEnriched>(); var result = context.Result<IEnrichedAssetEntity>();
var response = AssetDto.FromAsset(result, this, app); var response = AssetDto.FromAsset(result, this, app);
return response; return response;

2
src/Squidex/Areas/Api/Controllers/Assets/Models/AssetDto.cs

@ -118,7 +118,7 @@ namespace Squidex.Areas.Api.Controllers.Assets.Models
[JsonProperty("_meta")] [JsonProperty("_meta")]
public AssetMetadata Metadata { get; set; } public AssetMetadata Metadata { get; set; }
public static AssetDto FromAsset(IAssetEntityEnriched asset, ApiController controller, string app, bool isDuplicate = false) public static AssetDto FromAsset(IEnrichedAssetEntity asset, ApiController controller, string app, bool isDuplicate = false)
{ {
var response = SimpleMapper.Map(asset, new AssetDto { FileType = asset.FileName.FileType() }); var response = SimpleMapper.Map(asset, new AssetDto { FileType = asset.FileName.FileType() });

2
src/Squidex/Areas/Api/Controllers/Assets/Models/AssetsDto.cs

@ -37,7 +37,7 @@ namespace Squidex.Areas.Api.Controllers.Assets.Models
return Items.ToSurrogateKeys(); return Items.ToSurrogateKeys();
} }
public static AssetsDto FromAssets(IResultList<IAssetEntityEnriched> assets, ApiController controller, string app) public static AssetsDto FromAssets(IResultList<IEnrichedAssetEntity> assets, ApiController controller, string app)
{ {
var response = new AssetsDto var response = new AssetsDto
{ {

2
src/Squidex/Areas/Api/Controllers/Contents/ContentsController.cs

@ -445,7 +445,7 @@ namespace Squidex.Areas.Api.Controllers.Contents
{ {
var context = await CommandBus.PublishAsync(command); var context = await CommandBus.PublishAsync(command);
var result = context.Result<IContentEntityEnriched>(); var result = context.Result<IEnrichedContentEntity>();
var response = ContentDto.FromContent(null, result, this); var response = ContentDto.FromContent(null, result, this);
return response; return response;

4
src/Squidex/Areas/Api/Controllers/Contents/Models/ContentDto.cs

@ -84,7 +84,7 @@ namespace Squidex.Areas.Api.Controllers.Contents.Models
/// </summary> /// </summary>
public long Version { get; set; } public long Version { get; set; }
public static ContentDto FromContent(QueryContext context, IContentEntityEnriched content, ApiController controller) public static ContentDto FromContent(QueryContext context, IEnrichedContentEntity content, ApiController controller)
{ {
var response = SimpleMapper.Map(content, new ContentDto()); var response = SimpleMapper.Map(content, new ContentDto());
@ -107,7 +107,7 @@ namespace Squidex.Areas.Api.Controllers.Contents.Models
return response.CreateLinksAsync(content, controller, content.AppId.Name, content.SchemaId.Name); return response.CreateLinksAsync(content, controller, content.AppId.Name, content.SchemaId.Name);
} }
private ContentDto CreateLinksAsync(IContentEntityEnriched content, ApiController controller, string app, string schema) private ContentDto CreateLinksAsync(IEnrichedContentEntity content, ApiController controller, string app, string schema)
{ {
var values = new { app, name = schema, id = Id }; var values = new { app, name = schema, id = Id };

2
src/Squidex/Areas/Api/Controllers/Contents/Models/ContentsDto.cs

@ -47,7 +47,7 @@ namespace Squidex.Areas.Api.Controllers.Contents.Models
return Items.ToSurrogateKeys(); return Items.ToSurrogateKeys();
} }
public static async Task<ContentsDto> FromContentsAsync(IResultList<IContentEntityEnriched> contents, public static async Task<ContentsDto> FromContentsAsync(IResultList<IEnrichedContentEntity> contents,
QueryContext context, ApiController controller, ISchemaEntity schema, IContentWorkflow contentWorkflow) QueryContext context, ApiController controller, ISchemaEntity schema, IContentWorkflow contentWorkflow)
{ {
var result = new ContentsDto var result = new ContentsDto

79
tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetCommandMiddlewareTests.cs

@ -14,7 +14,6 @@ using FakeItEasy;
using FluentAssertions; using FluentAssertions;
using Orleans; using Orleans;
using Squidex.Domain.Apps.Core.Tags; using Squidex.Domain.Apps.Core.Tags;
using Squidex.Domain.Apps.Entities.Apps.Commands;
using Squidex.Domain.Apps.Entities.Assets.Commands; using Squidex.Domain.Apps.Entities.Assets.Commands;
using Squidex.Domain.Apps.Entities.Assets.State; using Squidex.Domain.Apps.Entities.Assets.State;
using Squidex.Domain.Apps.Entities.Tags; using Squidex.Domain.Apps.Entities.Tags;
@ -43,6 +42,10 @@ namespace Squidex.Domain.Apps.Entities.Assets
private readonly AssetFile file; private readonly AssetFile file;
private readonly AssetCommandMiddleware sut; private readonly AssetCommandMiddleware sut;
public sealed class MyCommand : SquidexCommand
{
}
protected override Guid Id protected override Guid Id
{ {
get { return assetId; } get { return assetId; }
@ -59,11 +62,14 @@ namespace Squidex.Domain.Apps.Entities.Assets
.ReturnsLazily(() => SimpleMapper.Map(asset.Snapshot, new AssetEntity())); .ReturnsLazily(() => SimpleMapper.Map(asset.Snapshot, new AssetEntity()));
A.CallTo(() => assetQuery.QueryByHashAsync(AppId, A<string>.Ignored)) A.CallTo(() => assetQuery.QueryByHashAsync(AppId, A<string>.Ignored))
.Returns(new List<IAssetEntityEnriched>()); .Returns(new List<IEnrichedAssetEntity>());
A.CallTo(() => grainFactory.GetGrain<IAssetGrain>(Id, null)) A.CallTo(() => grainFactory.GetGrain<IAssetGrain>(Id, null))
.Returns(asset); .Returns(asset);
A.CallTo(() => assetThumbnailGenerator.GetImageInfoAsync(stream))
.Returns(image);
sut = new AssetCommandMiddleware(grainFactory, sut = new AssetCommandMiddleware(grainFactory,
assetEnricher, assetEnricher,
assetQuery, assetQuery,
@ -74,23 +80,41 @@ namespace Squidex.Domain.Apps.Entities.Assets
[Fact] [Fact]
public async Task Should_not_invoke_enricher_for_other_result() public async Task Should_not_invoke_enricher_for_other_result()
{ {
var command = CreateCommand(new CreateApp()); var command = CreateCommand(new MyCommand());
var context = CreateContextForCommand(command); var context = CreateContextForCommand(command);
context.Complete(12); context.Complete(12);
await sut.HandleAsync(context); await sut.HandleAsync(context);
A.CallTo(() => assetEnricher.EnrichAsync(A<IAssetEntityEnriched>.Ignored)) A.CallTo(() => assetEnricher.EnrichAsync(A<IEnrichedAssetEntity>.Ignored))
.MustNotHaveHappened(); .MustNotHaveHappened();
} }
[Fact] [Fact]
public async Task Should_enrich_asset_result() public async Task Should_not_invoke_enricher_if_already_enriched()
{ {
var result = new AssetEntity(); var result = new AssetEntity();
var command = CreateCommand(new CreateAsset()); var command = CreateCommand(new MyCommand());
var context = CreateContextForCommand(command);
context.Complete(result);
await sut.HandleAsync(context);
Assert.Same(result, context.Result<IEnrichedAssetEntity>());
A.CallTo(() => assetEnricher.EnrichAsync(A<IEnrichedAssetEntity>.Ignored))
.MustNotHaveHappened();
}
[Fact]
public async Task Should_enrich_asset_result()
{
var result = A.Fake<IAssetEntity>();
var command = CreateCommand(new MyCommand());
var context = CreateContextForCommand(command); var context = CreateContextForCommand(command);
context.Complete(result); context.Complete(result);
@ -102,7 +126,7 @@ namespace Squidex.Domain.Apps.Entities.Assets
await sut.HandleAsync(context); await sut.HandleAsync(context);
Assert.Equal(enriched, context.Result<IAssetEntityEnriched>()); Assert.Same(enriched, context.Result<IEnrichedAssetEntity>());
} }
[Fact] [Fact]
@ -111,9 +135,6 @@ namespace Squidex.Domain.Apps.Entities.Assets
var command = CreateCommand(new CreateAsset { AssetId = assetId, File = file }); var command = CreateCommand(new CreateAsset { AssetId = assetId, File = file });
var context = CreateContextForCommand(command); var context = CreateContextForCommand(command);
SetupTags(command);
SetupImageInfo();
await sut.HandleAsync(context); await sut.HandleAsync(context);
var result = context.Result<AssetCreatedResult>(); var result = context.Result<AssetCreatedResult>();
@ -127,8 +148,6 @@ namespace Squidex.Domain.Apps.Entities.Assets
var command = CreateCommand(new CreateAsset { AssetId = assetId, File = file }); var command = CreateCommand(new CreateAsset { AssetId = assetId, File = file });
var context = CreateContextForCommand(command); var context = CreateContextForCommand(command);
SetupImageInfo();
await sut.HandleAsync(context); await sut.HandleAsync(context);
Assert.True(command.FileHash.Length > 10); Assert.True(command.FileHash.Length > 10);
@ -141,7 +160,6 @@ namespace Squidex.Domain.Apps.Entities.Assets
var context = CreateContextForCommand(command); var context = CreateContextForCommand(command);
SetupSameHashAsset(file.FileName, file.FileSize, out _); SetupSameHashAsset(file.FileName, file.FileSize, out _);
SetupImageInfo();
await sut.HandleAsync(context); await sut.HandleAsync(context);
@ -157,7 +175,6 @@ namespace Squidex.Domain.Apps.Entities.Assets
var context = CreateContextForCommand(command); var context = CreateContextForCommand(command);
SetupSameHashAsset("other-name", file.FileSize, out _); SetupSameHashAsset("other-name", file.FileSize, out _);
SetupImageInfo();
await sut.HandleAsync(context); await sut.HandleAsync(context);
@ -173,7 +190,6 @@ namespace Squidex.Domain.Apps.Entities.Assets
var context = CreateContextForCommand(command); var context = CreateContextForCommand(command);
SetupSameHashAsset(file.FileName, file.FileSize, out var duplicate); SetupSameHashAsset(file.FileName, file.FileSize, out var duplicate);
SetupImageInfo();
await sut.HandleAsync(context); await sut.HandleAsync(context);
@ -191,7 +207,6 @@ namespace Squidex.Domain.Apps.Entities.Assets
var context = CreateContextForCommand(command); var context = CreateContextForCommand(command);
SetupSameHashAsset(file.FileName, 12345, out _); SetupSameHashAsset(file.FileName, 12345, out _);
SetupImageInfo();
await sut.HandleAsync(context); await sut.HandleAsync(context);
@ -204,8 +219,6 @@ namespace Squidex.Domain.Apps.Entities.Assets
var command = CreateCommand(new UpdateAsset { AssetId = assetId, File = file }); var command = CreateCommand(new UpdateAsset { AssetId = assetId, File = file });
var context = CreateContextForCommand(command); var context = CreateContextForCommand(command);
SetupImageInfo();
await ExecuteCreateAsync(); await ExecuteCreateAsync();
await sut.HandleAsync(context); await sut.HandleAsync(context);
@ -220,8 +233,6 @@ namespace Squidex.Domain.Apps.Entities.Assets
var command = CreateCommand(new UpdateAsset { AssetId = assetId, File = file }); var command = CreateCommand(new UpdateAsset { AssetId = assetId, File = file });
var context = CreateContextForCommand(command); var context = CreateContextForCommand(command);
SetupImageInfo();
await ExecuteCreateAsync(); await ExecuteCreateAsync();
await sut.HandleAsync(context); await sut.HandleAsync(context);
@ -235,13 +246,11 @@ namespace Squidex.Domain.Apps.Entities.Assets
var command = CreateCommand(new UpdateAsset { AssetId = assetId, File = file }); var command = CreateCommand(new UpdateAsset { AssetId = assetId, File = file });
var context = CreateContextForCommand(command); var context = CreateContextForCommand(command);
SetupImageInfo();
await ExecuteCreateAsync(); await ExecuteCreateAsync();
await sut.HandleAsync(context); await sut.HandleAsync(context);
var result = context.Result<IAssetEntityEnriched>(); var result = context.Result<IEnrichedAssetEntity>();
result.Should().BeEquivalentTo(asset.Snapshot, x => x.ExcludingMissingMembers()); result.Should().BeEquivalentTo(asset.Snapshot, x => x.ExcludingMissingMembers());
} }
@ -252,13 +261,11 @@ namespace Squidex.Domain.Apps.Entities.Assets
var command = CreateCommand(new AnnotateAsset { AssetId = assetId, FileName = "newName" }); var command = CreateCommand(new AnnotateAsset { AssetId = assetId, FileName = "newName" });
var context = CreateContextForCommand(command); var context = CreateContextForCommand(command);
SetupImageInfo();
await ExecuteCreateAsync(); await ExecuteCreateAsync();
await sut.HandleAsync(context); await sut.HandleAsync(context);
var result = context.Result<IAssetEntityEnriched>(); var result = context.Result<IEnrichedAssetEntity>();
result.Should().BeEquivalentTo(asset.Snapshot, x => x.ExcludingMissingMembers()); result.Should().BeEquivalentTo(asset.Snapshot, x => x.ExcludingMissingMembers());
} }
@ -268,16 +275,6 @@ namespace Squidex.Domain.Apps.Entities.Assets
return asset.ExecuteAsync(CreateCommand(new CreateAsset { AssetId = Id, File = file })); return asset.ExecuteAsync(CreateCommand(new CreateAsset { AssetId = Id, File = file }));
} }
private void SetupTags(CreateAsset command)
{
A.CallTo(() => tagGenerator.GenerateTags(command, A<HashSet<string>>.Ignored))
.Invokes(new Action<CreateAsset, HashSet<string>>((c, tags) =>
{
tags.Add("tag1");
tags.Add("tag2");
}));
}
private void AssertAssetHasBeenUploaded(long version, Guid commitId) private void AssertAssetHasBeenUploaded(long version, Guid commitId)
{ {
var fileName = AssetStoreExtensions.GetFileName(assetId.ToString(), version); var fileName = AssetStoreExtensions.GetFileName(assetId.ToString(), version);
@ -290,7 +287,7 @@ namespace Squidex.Domain.Apps.Entities.Assets
.MustHaveHappened(); .MustHaveHappened();
} }
private void SetupSameHashAsset(string fileName, long fileSize, out IAssetEntityEnriched duplicate) private void SetupSameHashAsset(string fileName, long fileSize, out IEnrichedAssetEntity duplicate)
{ {
duplicate = new AssetEntity duplicate = new AssetEntity
{ {
@ -299,13 +296,7 @@ namespace Squidex.Domain.Apps.Entities.Assets
}; };
A.CallTo(() => assetQuery.QueryByHashAsync(A<Guid>.Ignored, A<string>.Ignored)) A.CallTo(() => assetQuery.QueryByHashAsync(A<Guid>.Ignored, A<string>.Ignored))
.Returns(new List<IAssetEntityEnriched> { duplicate }); .Returns(new List<IEnrichedAssetEntity> { duplicate });
}
private void SetupImageInfo()
{
A.CallTo(() => assetThumbnailGenerator.GetImageInfoAsync(stream))
.Returns(image);
} }
private void AssertAssetImageChecked() private void AssertAssetImageChecked()

6
tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetQueryServiceTests.cs

@ -85,7 +85,7 @@ namespace Squidex.Domain.Apps.Entities.Assets
.Returns(new List<IAssetEntity> { found }); .Returns(new List<IAssetEntity> { found });
A.CallTo(() => assetEnricher.EnrichAsync(A<IEnumerable<IAssetEntity>>.That.IsSameSequenceAs(found))) A.CallTo(() => assetEnricher.EnrichAsync(A<IEnumerable<IAssetEntity>>.That.IsSameSequenceAs(found)))
.Returns(new List<IAssetEntityEnriched> { enriched }); .Returns(new List<IEnrichedAssetEntity> { enriched });
var result = await sut.QueryByHashAsync(appId.Id, "hash"); var result = await sut.QueryByHashAsync(appId.Id, "hash");
@ -107,7 +107,7 @@ namespace Squidex.Domain.Apps.Entities.Assets
.Returns(ResultList.CreateFrom(8, found1, found2)); .Returns(ResultList.CreateFrom(8, found1, found2));
A.CallTo(() => assetEnricher.EnrichAsync(A<IEnumerable<IAssetEntity>>.That.IsSameSequenceAs(found1, found2))) A.CallTo(() => assetEnricher.EnrichAsync(A<IEnumerable<IAssetEntity>>.That.IsSameSequenceAs(found1, found2)))
.Returns(new List<IAssetEntityEnriched> { enriched1, enriched2 }); .Returns(new List<IEnrichedAssetEntity> { enriched1, enriched2 });
var result = await sut.QueryAsync(context, Q.Empty.WithIds(ids)); var result = await sut.QueryAsync(context, Q.Empty.WithIds(ids));
@ -129,7 +129,7 @@ namespace Squidex.Domain.Apps.Entities.Assets
.Returns(ResultList.CreateFrom(8, found1, found2)); .Returns(ResultList.CreateFrom(8, found1, found2));
A.CallTo(() => assetEnricher.EnrichAsync(A<IEnumerable<IAssetEntity>>.That.IsSameSequenceAs(found1, found2))) A.CallTo(() => assetEnricher.EnrichAsync(A<IEnumerable<IAssetEntity>>.That.IsSameSequenceAs(found1, found2)))
.Returns(new List<IAssetEntityEnriched> { enriched1, enriched2 }); .Returns(new List<IEnrichedAssetEntity> { enriched1, enriched2 });
var result = await sut.QueryAsync(context, Q.Empty); var result = await sut.QueryAsync(context, Q.Empty);

33
tests/Squidex.Domain.Apps.Entities.Tests/Contents/ContentCommandMiddlewareTests.cs

@ -9,7 +9,6 @@ using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using FakeItEasy; using FakeItEasy;
using Orleans; using Orleans;
using Squidex.Domain.Apps.Entities.Contents.Commands;
using Squidex.Domain.Apps.Entities.Contents.State; using Squidex.Domain.Apps.Entities.Contents.State;
using Squidex.Domain.Apps.Entities.TestHelpers; using Squidex.Domain.Apps.Entities.TestHelpers;
using Squidex.Infrastructure.Commands; using Squidex.Infrastructure.Commands;
@ -23,6 +22,10 @@ namespace Squidex.Domain.Apps.Entities.Contents
private readonly Guid contentId = Guid.NewGuid(); private readonly Guid contentId = Guid.NewGuid();
private readonly ContentCommandMiddleware sut; private readonly ContentCommandMiddleware sut;
public sealed class MyCommand : SquidexCommand
{
}
protected override Guid Id protected override Guid Id
{ {
get { return contentId; } get { return contentId; }
@ -36,23 +39,41 @@ namespace Squidex.Domain.Apps.Entities.Contents
[Fact] [Fact]
public async Task Should_not_invoke_enricher_for_other_result() public async Task Should_not_invoke_enricher_for_other_result()
{ {
var command = CreateCommand(new CreateContent()); var command = CreateCommand(new MyCommand());
var context = CreateContextForCommand(command); var context = CreateContextForCommand(command);
context.Complete(12); context.Complete(12);
await sut.HandleAsync(context); await sut.HandleAsync(context);
A.CallTo(() => contentEnricher.EnrichAsync(A<IContentEntityEnriched>.Ignored)) A.CallTo(() => contentEnricher.EnrichAsync(A<IEnrichedContentEntity>.Ignored))
.MustNotHaveHappened(); .MustNotHaveHappened();
} }
[Fact] [Fact]
public async Task Should_enrich_content_result() public async Task Should_not_invoke_enricher_if_already_enriched()
{ {
var result = new ContentEntity(); var result = new ContentEntity();
var command = CreateCommand(new CreateContent()); var command = CreateCommand(new MyCommand());
var context = CreateContextForCommand(command);
context.Complete(result);
await sut.HandleAsync(context);
Assert.Same(result, context.Result<IEnrichedContentEntity>());
A.CallTo(() => contentEnricher.EnrichAsync(A<IEnrichedContentEntity>.Ignored))
.MustNotHaveHappened();
}
[Fact]
public async Task Should_enrich_content_result()
{
var result = A.Fake<IContentEntity>();
var command = CreateCommand(new MyCommand());
var context = CreateContextForCommand(command); var context = CreateContextForCommand(command);
context.Complete(result); context.Complete(result);
@ -64,7 +85,7 @@ namespace Squidex.Domain.Apps.Entities.Contents
await sut.HandleAsync(context); await sut.HandleAsync(context);
Assert.Equal(enriched, context.Result<IContentEntityEnriched>()); Assert.Same(enriched, context.Result<IEnrichedContentEntity>());
} }
} }
} }

2
tests/Squidex.Domain.Apps.Entities.Tests/Contents/ContentQueryServiceTests.cs

@ -532,7 +532,7 @@ namespace Squidex.Domain.Apps.Entities.Contents
{ {
var input = (IEnumerable<IContentEntity>)x.Arguments[0]; var input = (IEnumerable<IContentEntity>)x.Arguments[0];
return Task.FromResult<IReadOnlyList<IContentEntityEnriched>>(input.Select(c => SimpleMapper.Map(c, new ContentEntity())).ToList()); return Task.FromResult<IReadOnlyList<IEnrichedContentEntity>>(input.Select(c => SimpleMapper.Map(c, new ContentEntity())).ToList());
}); });
} }

4
tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLTestBase.cs

@ -96,7 +96,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL
sut = CreateSut(); sut = CreateSut();
} }
protected static IContentEntityEnriched CreateContent(Guid id, Guid refId, Guid assetId, NamedContentData data = null, NamedContentData dataDraft = null) protected static IEnrichedContentEntity CreateContent(Guid id, Guid refId, Guid assetId, NamedContentData data = null, NamedContentData dataDraft = null)
{ {
var now = SystemClock.Instance.GetCurrentInstant(); var now = SystemClock.Instance.GetCurrentInstant();
@ -164,7 +164,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL
return content; return content;
} }
protected static IAssetEntityEnriched CreateAsset(Guid id) protected static IEnrichedAssetEntity CreateAsset(Guid id)
{ {
var now = SystemClock.Instance.GetCurrentInstant(); var now = SystemClock.Instance.GetCurrentInstant();

Loading…
Cancel
Save