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.
56 lines
1.5 KiB
56 lines
1.5 KiB
// ==========================================================================
|
|
// IdContentData.cs
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex Group
|
|
// All rights reserved.
|
|
// ==========================================================================
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using Squidex.Infrastructure;
|
|
|
|
namespace Squidex.Domain.Apps.Core.Contents
|
|
{
|
|
public sealed class IdContentData : ContentData<long>, IEquatable<IdContentData>
|
|
{
|
|
public IdContentData()
|
|
: base(EqualityComparer<long>.Default)
|
|
{
|
|
}
|
|
|
|
public IdContentData(IdContentData copy)
|
|
: base(copy, EqualityComparer<long>.Default)
|
|
{
|
|
}
|
|
|
|
public static IdContentData Merge(params IdContentData[] contents)
|
|
{
|
|
return MergeTo(new IdContentData(), contents);
|
|
}
|
|
|
|
public IdContentData MergeInto(IdContentData target)
|
|
{
|
|
return Merge(target, this);
|
|
}
|
|
|
|
public IdContentData ToCleaned()
|
|
{
|
|
return Clean(this, new IdContentData());
|
|
}
|
|
|
|
public IdContentData AddField(long id, ContentFieldData data)
|
|
{
|
|
Guard.GreaterThan(id, 0, nameof(id));
|
|
|
|
this[id] = data;
|
|
|
|
return this;
|
|
}
|
|
|
|
public bool Equals(IdContentData other)
|
|
{
|
|
return base.Equals(other);
|
|
}
|
|
}
|
|
}
|
|
|