Skip to content

Commit 48067d2

Browse files
committed
BREAKING: delete types and members flagged with ObsoleteAttribute
1 parent 8b95e9b commit 48067d2

39 files changed

Lines changed: 40 additions & 670 deletions

File tree

.clinerules

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ This is a .NET library providing **Smart Enums**, **Value Objects**, and **Discr
2323
- **`src/Thinktecture.Runtime.Extensions`**: Core library with base interfaces, attributes, and runtime helpers
2424
- Attributes: `SmartEnumAttribute<TKey>`, `SmartEnumAttribute`, `ValueObjectAttribute<TKey>`, `ComplexValueObjectAttribute`, `UnionAttribute<T1,T2,...>` (up to 5 type parameters), `AdHocUnionAttribute` (non-generic alternative to UnionAttribute), `UnionAttribute`, `ObjectFactoryAttribute<T>`
2525
- Additional attributes: `KeyMemberEqualityComparerAttribute`, `KeyMemberComparerAttribute`, `MemberEqualityComparerAttribute`, `IgnoreMemberAttribute`, `ValidationErrorAttribute`, `UseDelegateFromConstructorAttribute`, `UnionSwitchMapOverloadAttribute`
26-
- Key interfaces: `ISmartEnum<TKey>`, `IEnum`, `IKeyedObject<TKey>`, `IKeyedValueObject<TKey>`, `IComplexValueObject`, `IValidationError`, `IObjectFactory<T>`
26+
- Key interfaces: `ISmartEnum<TKey>`, `IEnum`, `IKeyedObject<TKey>`, `IKeyedValueObject<TKey>`, `IValidationError`, `IObjectFactory<T>`
2727
- Utility types: `ValidationError`, `ComparerAccessors`, collection helpers (EmptyDictionary, EmptyLookup, SingleItemReadOnlyDictionary, etc.)
2828
- Enums: `AccessModifier`, `MemberKind`, `OperatorsGeneration`, `ConversionOperatorsGeneration`, `SwitchMapMethodsGeneration`, `SerializationFrameworks`, `UnionConstructorAccessModifier`
2929
- **`src/Thinktecture.Runtime.Extensions.SourceGenerator`**: Roslyn Source Generators and Analyzers that create boilerplate code and validate usage for partial classes/structs
3030
- Contains 6 source generators, 2 analyzers, and 1 code fix provider
3131
- Organized into subdirectories: SmartEnums, ValueObjects, AdHocUnions, RegularUnions, ObjectFactories, Annotations, Diagnostics, CodeFixes
32-
- **Framework Integration Projects**: Separate projects for JSON, MessagePack, Newtonsoft.Json, ProtoBuf, Entity Framework Core (7/8/9), ASP.NET Core, and Swashbuckle
33-
- **EF Core**: Shared sources in `EntityFrameworkCore.Sources`, version-specific projects for EF Core 7/8/9
32+
- **Framework Integration Projects**: Separate projects for JSON, MessagePack, Newtonsoft.Json, ProtoBuf, Entity Framework Core (8/9/10), ASP.NET Core, and Swashbuckle
33+
- **EF Core**: Shared sources in `EntityFrameworkCore.Sources`, version-specific projects for EF Core 8/9/10
3434
- **Serialization**: Converters/formatters for System.Text.Json, MessagePack, Newtonsoft.Json, and ProtoBuf
3535

3636
### Source Generators and Analyzers
@@ -518,5 +518,3 @@ Notes:
518518
- UseWithEntityFramework: bool — enable EF Core integration for this factory
519519
- UseForModelBinding: bool (init-only) — enable ASP.NET Core model binding
520520
- HasCorrespondingConstructor: bool (init-only) — indicates presence of a single-parameter ctor of type `Type`
521-
- Obsolete alias:
522-
- ValueObjectFactoryAttribute<T> — use ObjectFactoryAttribute<T> instead

.github/copilot-instructions.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ This is a .NET library providing **Smart Enums**, **Value Objects**, and **Discr
2323
- **`src/Thinktecture.Runtime.Extensions`**: Core library with base interfaces, attributes, and runtime helpers
2424
- Attributes: `SmartEnumAttribute<TKey>`, `SmartEnumAttribute`, `ValueObjectAttribute<TKey>`, `ComplexValueObjectAttribute`, `UnionAttribute<T1,T2,...>` (up to 5 type parameters), `AdHocUnionAttribute` (non-generic alternative to UnionAttribute), `UnionAttribute`, `ObjectFactoryAttribute<T>`
2525
- Additional attributes: `KeyMemberEqualityComparerAttribute`, `KeyMemberComparerAttribute`, `MemberEqualityComparerAttribute`, `IgnoreMemberAttribute`, `ValidationErrorAttribute`, `UseDelegateFromConstructorAttribute`, `UnionSwitchMapOverloadAttribute`
26-
- Key interfaces: `ISmartEnum<TKey>`, `IEnum`, `IKeyedObject<TKey>`, `IKeyedValueObject<TKey>`, `IComplexValueObject`, `IValidationError`, `IObjectFactory<T>`
26+
- Key interfaces: `ISmartEnum<TKey>`, `IEnum`, `IKeyedObject<TKey>`, `IKeyedValueObject<TKey>`, `IValidationError`, `IObjectFactory<T>`
2727
- Utility types: `ValidationError`, `ComparerAccessors`, collection helpers (EmptyDictionary, EmptyLookup, SingleItemReadOnlyDictionary, etc.)
2828
- Enums: `AccessModifier`, `MemberKind`, `OperatorsGeneration`, `ConversionOperatorsGeneration`, `SwitchMapMethodsGeneration`, `SerializationFrameworks`, `UnionConstructorAccessModifier`
2929
- **`src/Thinktecture.Runtime.Extensions.SourceGenerator`**: Roslyn Source Generators and Analyzers that create boilerplate code and validate usage for partial classes/structs
3030
- Contains 6 source generators, 2 analyzers, and 1 code fix provider
3131
- Organized into subdirectories: SmartEnums, ValueObjects, AdHocUnions, RegularUnions, ObjectFactories, Annotations, Diagnostics, CodeFixes
32-
- **Framework Integration Projects**: Separate projects for JSON, MessagePack, Newtonsoft.Json, ProtoBuf, Entity Framework Core (7/8/9), ASP.NET Core, and Swashbuckle
33-
- **EF Core**: Shared sources in `EntityFrameworkCore.Sources`, version-specific projects for EF Core 7/8/9
32+
- **Framework Integration Projects**: Separate projects for JSON, MessagePack, Newtonsoft.Json, ProtoBuf, Entity Framework Core (8/9/10), ASP.NET Core, and Swashbuckle
33+
- **EF Core**: Shared sources in `EntityFrameworkCore.Sources`, version-specific projects for EF Core 8/9/10
3434
- **Serialization**: Converters/formatters for System.Text.Json, MessagePack, Newtonsoft.Json, and ProtoBuf
3535

3636
### Source Generators and Analyzers
@@ -518,5 +518,3 @@ Notes:
518518
- UseWithEntityFramework: bool — enable EF Core integration for this factory
519519
- UseForModelBinding: bool (init-only) — enable ASP.NET Core model binding
520520
- HasCorrespondingConstructor: bool (init-only) — indicates presence of a single-parameter ctor of type `Type`
521-
- Obsolete alias:
522-
- ValueObjectFactoryAttribute<T> — use ObjectFactoryAttribute<T> instead

CLAUDE.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ This is a .NET library providing **Smart Enums**, **Value Objects**, and **Discr
2323
- **`src/Thinktecture.Runtime.Extensions`**: Core library with base interfaces, attributes, and runtime helpers
2424
- Attributes: `SmartEnumAttribute<TKey>`, `SmartEnumAttribute`, `ValueObjectAttribute<TKey>`, `ComplexValueObjectAttribute`, `UnionAttribute<T1,T2,...>` (up to 5 type parameters), `AdHocUnionAttribute` (non-generic alternative to UnionAttribute), `UnionAttribute`, `ObjectFactoryAttribute<T>`
2525
- Additional attributes: `KeyMemberEqualityComparerAttribute`, `KeyMemberComparerAttribute`, `MemberEqualityComparerAttribute`, `IgnoreMemberAttribute`, `ValidationErrorAttribute`, `UseDelegateFromConstructorAttribute`, `UnionSwitchMapOverloadAttribute`
26-
- Key interfaces: `ISmartEnum<TKey>`, `IEnum`, `IKeyedObject<TKey>`, `IKeyedValueObject<TKey>`, `IComplexValueObject`, `IValidationError`, `IObjectFactory<T>`
26+
- Key interfaces: `ISmartEnum<TKey>`, `IEnum`, `IKeyedObject<TKey>`, `IKeyedValueObject<TKey>`, `IValidationError`, `IObjectFactory<T>`
2727
- Utility types: `ValidationError`, `ComparerAccessors`, collection helpers (EmptyDictionary, EmptyLookup, SingleItemReadOnlyDictionary, etc.)
2828
- Enums: `AccessModifier`, `MemberKind`, `OperatorsGeneration`, `ConversionOperatorsGeneration`, `SwitchMapMethodsGeneration`, `SerializationFrameworks`, `UnionConstructorAccessModifier`
2929
- **`src/Thinktecture.Runtime.Extensions.SourceGenerator`**: Roslyn Source Generators and Analyzers that create boilerplate code and validate usage for partial classes/structs
3030
- Contains 6 source generators, 2 analyzers, and 1 code fix provider
3131
- Organized into subdirectories: SmartEnums, ValueObjects, AdHocUnions, RegularUnions, ObjectFactories, Annotations, Diagnostics, CodeFixes
32-
- **Framework Integration Projects**: Separate projects for JSON, MessagePack, Newtonsoft.Json, ProtoBuf, Entity Framework Core (7/8/9), ASP.NET Core, and Swashbuckle
33-
- **EF Core**: Shared sources in `EntityFrameworkCore.Sources`, version-specific projects for EF Core 7/8/9
32+
- **Framework Integration Projects**: Separate projects for JSON, MessagePack, Newtonsoft.Json, ProtoBuf, Entity Framework Core (8/9/10), ASP.NET Core, and Swashbuckle
33+
- **EF Core**: Shared sources in `EntityFrameworkCore.Sources`, version-specific projects for EF Core 8/9/10
3434
- **Serialization**: Converters/formatters for System.Text.Json, MessagePack, Newtonsoft.Json, and ProtoBuf
3535

3636
### Source Generators and Analyzers
@@ -518,5 +518,3 @@ Notes:
518518
- UseWithEntityFramework: bool — enable EF Core integration for this factory
519519
- UseForModelBinding: bool (init-only) — enable ASP.NET Core model binding
520520
- HasCorrespondingConstructor: bool (init-only) — indicates presence of a single-parameter ctor of type `Type`
521-
- Obsolete alias:
522-
- ValueObjectFactoryAttribute<T> — use ObjectFactoryAttribute<T> instead

src/Thinktecture.Runtime.Extensions.AspNetCore/AspNetCore/ModelBinding/ThinktectureModelBinderProvider.cs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,6 @@
33

44
namespace Thinktecture.AspNetCore.ModelBinding;
55

6-
/// <summary>
7-
/// Provider for creation of model binders for Smart Enums and for Value Objects with a key member.
8-
/// </summary>
9-
[Obsolete("Use 'ThinktectureModelBinderProvider' instead.")]
10-
public sealed class ValueObjectModelBinderProvider : ThinktectureModelBinderProvider
11-
{
12-
/// <summary>
13-
/// Initializes new instance of <see cref="ValueObjectModelBinderProvider"/>.
14-
/// </summary>
15-
/// <param name="skipBindingFromBody">Indication whether to skip model binding if the raw value comes from request body.</param>
16-
public ValueObjectModelBinderProvider(bool skipBindingFromBody = true)
17-
: base(skipBindingFromBody)
18-
{
19-
}
20-
21-
/// <summary>
22-
/// Initializes new instance of <see cref="ValueObjectModelBinderProvider"/>.
23-
/// </summary>
24-
/// <param name="trimStringBasedEnums">Indication whether to trim string-values before parsing them.</param>
25-
/// <param name="skipBindingFromBody">Indication whether to skip model binding if the raw value comes from request body.</param>
26-
[Obsolete("Use constructor without 'trimStringBasedEnums' parameter instead")]
27-
public ValueObjectModelBinderProvider(
28-
bool trimStringBasedEnums,
29-
bool skipBindingFromBody = true)
30-
: this(skipBindingFromBody)
31-
{
32-
}
33-
}
34-
356
/// <summary>
367
/// Provider for creation of model binders for Smart Enums and for Value Objects with a key member.
378
/// </summary>

src/Thinktecture.Runtime.Extensions.AspNetCore/AspNetCore/ModelBinding/TrimmingSmartEnumModelBinder.cs

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/Thinktecture.Runtime.Extensions.AspNetCore/AspNetCore/ModelBinding/ValueObjectModelBinder.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
namespace Thinktecture.AspNetCore.ModelBinding;
22

3-
/// <summary>
4-
/// Model binder for Smart Enums Value Objects with a key member.
5-
/// </summary>
6-
/// <typeparam name="T">Type of the value object.</typeparam>
7-
/// <typeparam name="TKey">Type of the key member.</typeparam>
8-
/// <typeparam name="TValidationError">Type of the validation error.</typeparam>
9-
[Obsolete("Use 'ThinktectureModelBinderProvider' instead")]
10-
public sealed class ValueObjectModelBinder<T, TKey, TValidationError> : ThinktectureModelBinderBase<T, TKey, TValidationError>
11-
where T : IObjectFactory<T, TKey, TValidationError>
12-
where TKey : notnull
13-
where TValidationError : class, IValidationError<TValidationError>;
14-
153
/// <summary>
164
/// Model binder for Smart Enums Value Objects with a key member.
175
/// </summary>

src/Thinktecture.Runtime.Extensions.EntityFrameworkCore.Sources/EntityFrameworkCore/Storage/ValueConversion/ThinktectureValueConverterFactory.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66

77
namespace Thinktecture.EntityFrameworkCore.Storage.ValueConversion;
88

9-
/// <summary>
10-
/// Value converter for Smart Enums and for Value Objects with a key member.
11-
/// </summary>
12-
[Obsolete("Use 'AddThinktectureValueConverters()' or 'UseThinktectureValueConverters()' with corresponding builder instead.")]
13-
public sealed class ValueObjectValueConverterFactory : ThinktectureValueConverterFactory;
14-
159
/// <summary>
1610
/// Value converter for Smart Enums and for Value Objects with a key member.
1711
/// </summary>

src/Thinktecture.Runtime.Extensions.EntityFrameworkCore.Sources/Extensions/ComplexTypePropertyBuilderExtensions.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,6 @@ namespace Thinktecture;
88
/// </summary>
99
public static class ComplexTypePropertyBuilderExtensions
1010
{
11-
/// <summary>
12-
/// Configures a complex type property to use value object conversion.
13-
/// </summary>
14-
/// <typeparam name="TProperty">The property type.</typeparam>
15-
/// <param name="propertyBuilder">The complex type property builder.</param>
16-
/// <param name="useConstructorForRead">For keyed value objects only. Whether to use the constructor when reading from the database.</param>
17-
/// <returns>The complex type property builder for chaining.</returns>
18-
[Obsolete("Use 'HasThinktectureValueConverter' instead.")]
19-
public static ComplexTypePropertyBuilder<TProperty> HasValueObjectConversion<TProperty>(
20-
this ComplexTypePropertyBuilder<TProperty> propertyBuilder,
21-
bool useConstructorForRead = true)
22-
{
23-
return propertyBuilder.HasThinktectureValueConverter(useConstructorForRead);
24-
}
25-
2611
/// <summary>
2712
/// Configures a complex type property to use value converter for Smart Enums and Value Objects.
2813
/// </summary>

src/Thinktecture.Runtime.Extensions.EntityFrameworkCore.Sources/Extensions/DbContextOptionsBuilderExtensions.cs

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,6 @@ namespace Thinktecture;
1111
/// </summary>
1212
public static class DbContextOptionsBuilderExtensions
1313
{
14-
/// <summary>
15-
/// Enables automatic configuration of <see cref="ValueConverter"/> for Smart Enums and Value Objects.
16-
/// </summary>
17-
/// <param name="builder">Options builder.</param>
18-
/// <param name="useThinktectureConverters">Indication whether to enable or disable the feature.</param>
19-
/// <param name="useConstructorForRead">For keyed value objects only. Use the constructor instead of the factory method when reading the data from the database.</param>
20-
/// <param name="configureEnumsAndKeyedValueObjects">Action for further configuration of the property.</param>
21-
/// <returns>The provided <paramref name="builder"/>.</returns>
22-
[Obsolete("Use 'UseThinktectureValueConverters' instead.")]
23-
public static DbContextOptionsBuilder<T> UseValueObjectValueConverter<T>(
24-
this DbContextOptionsBuilder<T> builder,
25-
bool useThinktectureConverters = true,
26-
bool useConstructorForRead = true,
27-
Action<IConventionProperty>? configureEnumsAndKeyedValueObjects = null)
28-
where T : DbContext
29-
{
30-
return builder.UseThinktectureValueConverters(useThinktectureConverters, useConstructorForRead, configureEnumsAndKeyedValueObjects);
31-
}
32-
33-
/// <summary>
34-
/// Enables automatic configuration of <see cref="ValueConverter"/> for Smart Enums and Value Objects.
35-
/// </summary>
36-
/// <param name="builder">Options builder.</param>
37-
/// <param name="useThinktectureConverters">Indication whether to enable or disable the feature.</param>
38-
/// <param name="useConstructorForRead">For keyed value objects only. Use the constructor instead of the factory method when reading the data from a database.</param>
39-
/// <param name="configureEnumsAndKeyedValueObjects">Action for further configuration of the property.</param>
40-
/// <returns>The provided <paramref name="builder"/>.</returns>
41-
[Obsolete("Use 'UseThinktectureValueConverters' instead.")]
42-
public static DbContextOptionsBuilder UseValueObjectValueConverter(
43-
this DbContextOptionsBuilder builder,
44-
bool useThinktectureConverters = true,
45-
bool useConstructorForRead = true,
46-
Action<IConventionProperty>? configureEnumsAndKeyedValueObjects = null)
47-
{
48-
return builder.UseThinktectureValueConverters(useThinktectureConverters, useConstructorForRead, configureEnumsAndKeyedValueObjects);
49-
}
50-
5114
/// <summary>
5215
/// Enables automatic configuration of <see cref="ValueConverter"/> for Smart Enums and Value Objects.
5316
/// </summary>

0 commit comments

Comments
 (0)