Files
prefab-page-detail/Prefab/Domain/Events/GenericAttributeChangedEvent.cs
2025-10-27 17:39:18 -04:00

26 lines
956 B
C#

using Prefab.Domain.Common;
namespace Prefab.Domain.Events;
/// <summary>
/// Event raised whenever a generic attribute is added, updated, or removed from an entity.
/// </summary>
/// <param name="Entity">The entity that owns the attribute.</param>
/// <param name="Key">The attribute key.</param>
/// <param name="Value">The attribute value involved in the change.</param>
/// <param name="ChangeType">Indicates the type of mutation performed.</param>
public record GenericAttributeChangedEvent(object Entity, string Key, object? Value, GenericAttributeChangeType ChangeType) : Event;
/// <summary>
/// Represents the types of mutations that can occur for a generic attribute.
/// </summary>
public enum GenericAttributeChangeType
{
/// <summary>Attribute was added for the first time.</summary>
Add,
/// <summary>Attribute was updated with a new value.</summary>
Update,
/// <summary>Attribute was removed.</summary>
Remove
}