From c8b522e26534aeec5897893eb44f1ff22eb88308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20Ko=C5=BEelj?= Date: Mon, 5 Dec 2022 17:37:30 +0100 Subject: [PATCH] Rebase with github repository --- .../Annotations/PartitionKeyAttribute.cs | 4 ++++ Connected.ServiceModel/Data/ITableEntity.cs | 6 ++---- Connected.ServiceModel/Data/TableEntity.cs | 8 ++------ Connected.ServiceModel/Search/SearchEntity.cs | 2 ++ 4 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 Connected.ServiceModel/Annotations/PartitionKeyAttribute.cs 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 {