diff --git a/Connected.ServiceModel/Annotations/PartitionKeyAttribute.cs b/Connected.ServiceModel/Annotations/PartitionKeyAttribute.cs new file mode 100644 index 0000000..730a283 --- /dev/null +++ b/Connected.ServiceModel/Annotations/PartitionKeyAttribute.cs @@ -0,0 +1,4 @@ +namespace Connected.ServiceModel.Annotations; +public sealed class PartitionKeyAttribute : Attribute +{ +} diff --git a/Connected.ServiceModel/Data/ITableEntity.cs b/Connected.ServiceModel/Data/ITableEntity.cs index 2f0a854..3a72ec0 100644 --- a/Connected.ServiceModel/Data/ITableEntity.cs +++ b/Connected.ServiceModel/Data/ITableEntity.cs @@ -1,10 +1,8 @@ -using Connected.Entities.Consistency; +using Connected.Entities; namespace Connected.ServiceModel.Data; -public interface ITableEntity : IConsistentEntity +public interface ITableEntity : IEntity where TPrimaryKey : notnull - where TPartitionKey : notnull { - TPartitionKey PartitionKey { get; init; } } diff --git a/Connected.ServiceModel/Data/TableEntity.cs b/Connected.ServiceModel/Data/TableEntity.cs index b2dce90..3c7cbba 100644 --- a/Connected.ServiceModel/Data/TableEntity.cs +++ b/Connected.ServiceModel/Data/TableEntity.cs @@ -1,12 +1,8 @@ -using Connected.Annotations; -using Connected.Entities.Consistency; +using Connected.Entities; namespace Connected.ServiceModel.Data; -public abstract record TableEntity : ConsistentEntity, ITableEntity +public abstract record TableEntity : Entity, ITableEntity where TPrimaryKey : notnull - where TPartitionKey : notnull { - [Ordinal(-1)] - public TPartitionKey PartitionKey { get; init; } = default!; } diff --git a/Connected.ServiceModel/Search/SearchEntity.cs b/Connected.ServiceModel/Search/SearchEntity.cs index a6d3dc3..9c90fb4 100644 --- a/Connected.ServiceModel/Search/SearchEntity.cs +++ b/Connected.ServiceModel/Search/SearchEntity.cs @@ -3,6 +3,8 @@ using Connected.Entities.Annotations; using Connected.Entities.Consistency; namespace Connected.ServiceModel.Search; + +[Persistence(Persistence = ColumnPersistence.InMemory)] public record SearchEntity : ConsistentEntity, ISearchEntity where TPrimaryKey : notnull {