2025-09-30 16:57:05 +02:00

19 lines
753 B
C#

#if NET
namespace DigitalData.Core.Abstraction.Application.DTO;
/// <summary>
/// Represents a base Data Transfer Object (DTO) with an identifier.
/// </summary>
/// <typeparam name="TId">The type of the identifier.</typeparam>
/// <param name="Id">The identifier of the DTO.</param>
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
public record BaseDTO<TId>(TId Id) where TId : notnull
{
/// <summary>
/// Returns the hash code for this instance, based on the identifier.
/// This override ensures that the hash code is derived consistently from the identifier.
/// </summary>
/// <returns>A hash code for the current object, derived from the identifier.</returns>
public override int GetHashCode() => Id.GetHashCode();
}
#endif