mirror of https://github.com/Squidex/squidex.git
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.5 KiB
47 lines
1.5 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using System.Linq;
|
|
using Squidex.Domain.Apps.Entities.Contents.Commands;
|
|
using Squidex.Infrastructure.Reflection;
|
|
using Squidex.Infrastructure.Validation;
|
|
|
|
namespace Squidex.Areas.Api.Controllers.Contents.Models
|
|
{
|
|
public sealed class BulkUpdateDto
|
|
{
|
|
/// <summary>
|
|
/// The contents to update or insert.
|
|
/// </summary>
|
|
[LocalizedRequired]
|
|
public BulkUpdateJobDto[]? Jobs { get; set; }
|
|
|
|
/// <summary>
|
|
/// True to automatically publish the content.
|
|
/// </summary>
|
|
public bool Publish { get; set; }
|
|
|
|
/// <summary>
|
|
/// True to turn off scripting for faster inserts. Default: true.
|
|
/// </summary>
|
|
public bool DoNotScript { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// True to turn off costly validation: Unique checks, asset checks and reference checks. Default: true.
|
|
/// </summary>
|
|
public bool OptimizeValidation { get; set; } = true;
|
|
|
|
public BulkUpdateContents ToCommand()
|
|
{
|
|
var result = SimpleMapper.Map(this, new BulkUpdateContents());
|
|
|
|
result.Jobs = Jobs?.Select(x => x.ToJob())?.ToArray();
|
|
|
|
return result;
|
|
}
|
|
}
|
|
}
|
|
|