diff --git a/src/EventSourcingTests/archiving_events.cs b/src/EventSourcingTests/archiving_events.cs index 0c023581e4..ef8afe0bc6 100644 --- a/src/EventSourcingTests/archiving_events.cs +++ b/src/EventSourcingTests/archiving_events.cs @@ -647,7 +647,7 @@ public record Deleted; public record MaybeDeleted(bool ShouldDelete); [StronglyTypedId(Template.Guid)] -public partial struct GuidId; +public readonly partial struct GuidId; public class SimpleAggregateStrongTypedGuid { @@ -690,7 +690,7 @@ public void Apply(EEvent _) } [StronglyTypedId(Template.String)] -public partial struct StringId; +public readonly partial struct StringId; public class SimpleAggregateStrongTypedString { diff --git a/src/ValueTypeTests/StrongTypedId/guid_based_document_operations.cs b/src/ValueTypeTests/StrongTypedId/guid_based_document_operations.cs index 72431d9c34..d5c39674de 100644 --- a/src/ValueTypeTests/StrongTypedId/guid_based_document_operations.cs +++ b/src/ValueTypeTests/StrongTypedId/guid_based_document_operations.cs @@ -279,10 +279,10 @@ public async Task bulk_writing_sync() [StronglyTypedId(Template.Guid)] -public partial struct Invoice2Id; +public readonly partial struct Invoice2Id; [StronglyTypedId(Template.Guid)] -public partial struct WrongId; +public readonly partial struct WrongId; public class Invoice2 { diff --git a/src/ValueTypeTests/StrongTypedId/int_based_document_operations.cs b/src/ValueTypeTests/StrongTypedId/int_based_document_operations.cs index 43bfa515a7..b8a5c2e09d 100644 --- a/src/ValueTypeTests/StrongTypedId/int_based_document_operations.cs +++ b/src/ValueTypeTests/StrongTypedId/int_based_document_operations.cs @@ -262,7 +262,7 @@ public async Task use_in_LINQ_select_clause() #region sample_order2_with_STRONG_TYPED_identifier [StronglyTypedId(Template.Int)] -public partial struct Order2Id; +public readonly partial struct Order2Id; public class Order2 { diff --git a/src/ValueTypeTests/StrongTypedId/linq_querying_with_value_types.cs b/src/ValueTypeTests/StrongTypedId/linq_querying_with_value_types.cs index 524bc3433e..3dd96dfc2b 100644 --- a/src/ValueTypeTests/StrongTypedId/linq_querying_with_value_types.cs +++ b/src/ValueTypeTests/StrongTypedId/linq_querying_with_value_types.cs @@ -207,16 +207,16 @@ public async Task store_several_and_use_in_LINQ_select() } [StronglyTypedId(Template.Long)] -public partial struct UpperLimit; +public readonly partial struct UpperLimit; [StronglyTypedId(Template.Int)] -public partial struct LowerLimit; +public readonly partial struct LowerLimit; [StronglyTypedId(Template.String)] -public partial struct Description; +public readonly partial struct Description; [StronglyTypedId(Template.Guid)] -public partial struct GuidId; +public readonly partial struct GuidId; public class LimitedDoc { diff --git a/src/ValueTypeTests/StrongTypedId/long_based_document_operations.cs b/src/ValueTypeTests/StrongTypedId/long_based_document_operations.cs index 7eb2360ddf..766b7ea197 100644 --- a/src/ValueTypeTests/StrongTypedId/long_based_document_operations.cs +++ b/src/ValueTypeTests/StrongTypedId/long_based_document_operations.cs @@ -267,7 +267,7 @@ public async Task use_in_LINQ_select_clause() } [StronglyTypedId(Template.Long)] -public partial struct Issue2Id; +public readonly partial struct Issue2Id; public class Issue2 { diff --git a/src/ValueTypeTests/StrongTypedId/string_id_document_operations.cs b/src/ValueTypeTests/StrongTypedId/string_id_document_operations.cs index 1fd74b9e4a..ca5fa955ae 100644 --- a/src/ValueTypeTests/StrongTypedId/string_id_document_operations.cs +++ b/src/ValueTypeTests/StrongTypedId/string_id_document_operations.cs @@ -237,10 +237,10 @@ public async Task use_in_LINQ_select_clause() } [StronglyTypedId(Template.String)] -public partial struct Team2Id; +public readonly partial struct Team2Id; [StronglyTypedId(Template.String)] -public partial struct WrongStringId; +public readonly partial struct WrongStringId; public class Team2 diff --git a/src/ValueTypeTests/TestingTypes.cs b/src/ValueTypeTests/TestingTypes.cs index 40e2334a8d..e45c558251 100644 --- a/src/ValueTypeTests/TestingTypes.cs +++ b/src/ValueTypeTests/TestingTypes.cs @@ -6,19 +6,19 @@ namespace ValueTypeTests; [ValueObject] -public partial struct GuidId; +public readonly partial struct GuidId; [ValueObject] -public partial struct IntId; +public readonly partial struct IntId; [ValueObject] -public partial struct LongId; +public readonly partial struct LongId; [ValueObject] -public partial struct StringId; +public readonly partial struct StringId; [ValueObject] -public partial struct DateId; +public readonly partial struct DateId; public record struct NewGuidId(Guid Value); public record struct NewIntId(int Value); @@ -39,7 +39,7 @@ public record struct TaskId(Guid Value); /// with a public static method that takes in the /// inner value /// -public struct Task2Id +public readonly struct Task2Id { private Task2Id(Guid value) => Value = value; diff --git a/src/ValueTypeTests/VogenIds/guid_based_document_operations.cs b/src/ValueTypeTests/VogenIds/guid_based_document_operations.cs index 552580aad7..a2e731d992 100644 --- a/src/ValueTypeTests/VogenIds/guid_based_document_operations.cs +++ b/src/ValueTypeTests/VogenIds/guid_based_document_operations.cs @@ -287,7 +287,7 @@ public async Task bulk_writing_sync() #region sample_invoice_with_vogen_id [ValueObject] -public partial struct InvoiceId; +public readonly partial struct InvoiceId; public class Invoice { @@ -303,4 +303,4 @@ public class Invoice [ValueObject] -public partial struct WrongId; +public readonly partial struct WrongId; diff --git a/src/ValueTypeTests/VogenIds/int_based_document_operations.cs b/src/ValueTypeTests/VogenIds/int_based_document_operations.cs index 0701a2791c..f6c4965733 100644 --- a/src/ValueTypeTests/VogenIds/int_based_document_operations.cs +++ b/src/ValueTypeTests/VogenIds/int_based_document_operations.cs @@ -259,7 +259,7 @@ public async Task use_in_LINQ_select_clause() } [ValueObject] -public partial struct OrderId; +public readonly partial struct OrderId; public class Order { diff --git a/src/ValueTypeTests/VogenIds/linq_querying_with_value_types.cs b/src/ValueTypeTests/VogenIds/linq_querying_with_value_types.cs index 979e0ff869..0eb2e3197e 100644 --- a/src/ValueTypeTests/VogenIds/linq_querying_with_value_types.cs +++ b/src/ValueTypeTests/VogenIds/linq_querying_with_value_types.cs @@ -217,16 +217,16 @@ public async Task store_several_and_use_in_LINQ_select() #region sample_limited_doc [ValueObject] -public partial struct UpperLimit; +public readonly partial struct UpperLimit; [ValueObject] -public partial struct LowerLimit; +public readonly partial struct LowerLimit; [ValueObject] -public partial struct Description; +public readonly partial struct Description; [ValueObject] -public partial struct GuidId; +public readonly partial struct GuidId; public class LimitedDoc { diff --git a/src/ValueTypeTests/VogenIds/long_based_document_operations.cs b/src/ValueTypeTests/VogenIds/long_based_document_operations.cs index 94a280d708..3806b0c700 100644 --- a/src/ValueTypeTests/VogenIds/long_based_document_operations.cs +++ b/src/ValueTypeTests/VogenIds/long_based_document_operations.cs @@ -259,7 +259,7 @@ public async Task use_in_LINQ_select_clause() } [ValueObject] -public partial struct IssueId; +public readonly partial struct IssueId; public class Issue { diff --git a/src/ValueTypeTests/VogenIds/string_id_document_operations.cs b/src/ValueTypeTests/VogenIds/string_id_document_operations.cs index 81ec1f1401..929206e557 100644 --- a/src/ValueTypeTests/VogenIds/string_id_document_operations.cs +++ b/src/ValueTypeTests/VogenIds/string_id_document_operations.cs @@ -236,10 +236,10 @@ public async Task use_in_LINQ_select_clause() } [ValueObject] -public partial struct TeamId; +public readonly partial struct TeamId; [ValueObject] -public partial struct WrongStringId; +public readonly partial struct WrongStringId; public class Team diff --git a/src/ValueTypeTests/include_usage.cs b/src/ValueTypeTests/include_usage.cs index 78a019f540..5285f1e461 100644 --- a/src/ValueTypeTests/include_usage.cs +++ b/src/ValueTypeTests/include_usage.cs @@ -108,7 +108,7 @@ public async Task include_multiple_references() } [ValueObject] -public partial struct TeacherId; +public readonly partial struct TeacherId; public class Teacher { @@ -116,7 +116,7 @@ public class Teacher } [ValueObject] -public partial struct ClassId; +public readonly partial struct ClassId; public class Class { @@ -125,7 +125,7 @@ public class Class } [ValueObject] -public partial struct GradeId; +public readonly partial struct GradeId; public class Grade { diff --git a/src/ValueTypeTests/linq_querying_with_value_types.cs b/src/ValueTypeTests/linq_querying_with_value_types.cs index b92d520f47..931a38820c 100644 --- a/src/ValueTypeTests/linq_querying_with_value_types.cs +++ b/src/ValueTypeTests/linq_querying_with_value_types.cs @@ -127,10 +127,10 @@ public Expression, IEnumerable>> Q #region sample_limited_doc [ValueObject] -public partial struct UpperLimit; +public readonly partial struct UpperLimit; [ValueObject] -public partial struct LowerLimit; +public readonly partial struct LowerLimit; public class LimitedDoc { diff --git a/src/ValueTypeTests/registration.cs b/src/ValueTypeTests/registration.cs index 184dbd4de8..daed2b77ff 100644 --- a/src/ValueTypeTests/registration.cs +++ b/src/ValueTypeTests/registration.cs @@ -41,7 +41,7 @@ public void sad_path_registration(Type type) public record struct ExternalId(string Value); -public struct SpecialValue +public readonly struct SpecialValue { private SpecialValue(string value) {