using Connected.Annotations; using Connected.Caching.Annotations; using Connected.Entities.Annotations; using System.ComponentModel; using System.Text.Json.Serialization; namespace Connected.Entities; public abstract record Entity : IEntity { [DefaultValue(State.Default), JsonIgnore, Persistence(Persistence = ColumnPersistence.InMemory)] public State State { get; init; } } public abstract record Entity : Entity, IEntity where T : notnull { protected Entity() { Id = default!; } [PrimaryKey, CacheKey, ReturnValue, Ordinal(-10000)] public virtual T Id { get; init; } }