:drunk: AI trying to fix bugs
This commit is contained in:
@ -1,10 +1,33 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using NodaTime;
|
||||
|
||||
namespace DysonNetwork.Common.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Base class for all entity models in the system.
|
||||
/// Provides common properties and functionality for tracking entity lifecycle.
|
||||
/// </summary>
|
||||
public abstract class ModelBase
|
||||
{
|
||||
public Instant CreatedAt { get; set; }
|
||||
public Instant UpdatedAt { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier for the entity.
|
||||
/// </summary>
|
||||
[Key]
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date and time when the entity was created, in UTC.
|
||||
/// </summary>
|
||||
public Instant CreatedAt { get; set; } = SystemClock.Instance.GetCurrentInstant();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date and time when the entity was last updated, in UTC.
|
||||
/// </summary>
|
||||
public Instant UpdatedAt { get; set; } = SystemClock.Instance.GetCurrentInstant();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date and time when the entity was soft-deleted, in UTC.
|
||||
/// Null if the entity has not been deleted.
|
||||
/// </summary>
|
||||
public Instant? DeletedAt { get; set; }
|
||||
}
|
Reference in New Issue
Block a user