Headless CMS and Content Managment Hub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

47 lines
1.6 KiB

// ==========================================================================
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex UG (haftungsbeschraenkt)
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Squidex.ClientLibrary;
using Squidex.ClientLibrary.Management;
namespace TestSuite.Model
{
public sealed class TestEntityWithReferences : SquidexEntityBase<TestEntityWithReferencesData>
{
public static async Task<SchemaDetailsDto> CreateSchemaAsync(ISchemasClient schemas, string appName, string name)
{
var schema = await schemas.PostSchemaAsync(appName, new CreateSchemaDto
{
Name = name,
Fields = new List<UpsertSchemaFieldDto>
{
new UpsertSchemaFieldDto
{
Name = nameof(TestEntityWithReferencesData.References).ToLowerInvariant(),
Properties = new ReferencesFieldPropertiesDto
{
IsRequired = false
}
}
},
IsPublished = true
});
return schema;
}
}
public sealed class TestEntityWithReferencesData
{
[JsonConverter(typeof(InvariantConverter))]
public Guid[] References { get; set; }
}
}