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.
38 lines
1.2 KiB
38 lines
1.2 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using Squidex.Domain.Apps.Entities.Rules.Runner;
|
|
using Squidex.Infrastructure.Validation;
|
|
using Squidex.Web;
|
|
|
|
namespace Squidex.Areas.Api.Controllers.Rules.Models
|
|
{
|
|
public sealed class SimulatedRuleEventsDto : Resource
|
|
{
|
|
/// <summary>
|
|
/// The simulated rule events.
|
|
/// </summary>
|
|
[LocalizedRequired]
|
|
public SimulatedRuleEventDto[] Items { get; set; }
|
|
|
|
/// <summary>
|
|
/// The total number of simulated rule events.
|
|
/// </summary>
|
|
public long Total { get; set; }
|
|
|
|
public static SimulatedRuleEventsDto FromDomain(IList<SimulatedRuleEvent> events)
|
|
{
|
|
var result = new SimulatedRuleEventsDto
|
|
{
|
|
Total = events.Count,
|
|
Items = events.Select(SimulatedRuleEventDto.FromDomain).ToArray()
|
|
};
|
|
|
|
return result;
|
|
}
|
|
}
|
|
}
|
|
|