Skip to content

Commit 263d77c

Browse files
louis4liclaude
andcommitted
refactor: Remove unused CompatibleGrainSerializer, focus on Orleans compatibility only
- Remove CompatibleGrainSerializer and related configuration methods - Remove CompatibilityTests.cs and related test methods - Keep only OrleansCompatibleGrainSerializer for Orleans LogStateWithMetaData support - Simplify codebase to focus on actual use case (Orleans → MongoDB migration) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 62c69a3 commit 263d77c

4 files changed

Lines changed: 0 additions & 316 deletions

File tree

src/Aevatar.EventSourcing.MongoDB/Hosting/MongoDbStorageServiceCollectionExtensions.cs

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -87,43 +87,6 @@ public static IServiceCollection AddMongoDbBasedLogConsistencyProvider(this ISer
8787
return services;
8888
}
8989

90-
/// <summary>
91-
/// Adds MongoDB-based log consistency provider with backward compatibility for Memory storage format
92-
/// </summary>
93-
public static IServiceCollection AddCompatibleMongoDbBasedLogConsistencyProvider(this IServiceCollection services,
94-
string name, Action<OptionsBuilder<MongoDbStorageOptions>>? configureOptions = null)
95-
{
96-
// Register the compatible serializer
97-
services.AddKeyedSingleton<IGrainStateSerializer>(name, (sp, key) => new CompatibleGrainSerializer());
98-
99-
// Use the standard MongoDB provider setup
100-
return services.AddMongoDbBasedLogConsistencyProvider(name, configureOptions);
101-
}
102-
103-
/// <summary>
104-
/// Adds MongoDB-based log consistency provider as default with backward compatibility for Memory storage format
105-
/// </summary>
106-
public static IServiceCollection AddCompatibleMongoDbBasedLogConsistencyProviderAsDefault(this IServiceCollection services,
107-
Action<OptionsBuilder<MongoDbStorageOptions>>? configureOptions = null)
108-
{
109-
return services.AddCompatibleMongoDbBasedLogConsistencyProvider(
110-
ProviderConstants.DEFAULT_STORAGE_PROVIDER_NAME, configureOptions);
111-
}
112-
113-
/// <summary>
114-
/// Adds MongoDB-based log consistency provider with backward compatibility and custom serializer configuration
115-
/// </summary>
116-
public static IServiceCollection AddCompatibleMongoDbBasedLogConsistencyProvider(this IServiceCollection services,
117-
string name, Action<MongoDbStorageOptions> configureOptions, bool useCompatibleSerializer = true)
118-
{
119-
if (useCompatibleSerializer)
120-
{
121-
// Register the compatible serializer
122-
services.AddKeyedSingleton<IGrainStateSerializer>(name, (sp, key) => new CompatibleGrainSerializer());
123-
}
124-
125-
return services.AddMongoDbBasedLogConsistencyProvider(name, configureOptions);
126-
}
12790

12891

12992
/// <summary>

src/Aevatar.EventSourcing.MongoDB/Serializers/CompatibleGrainSerializer.cs

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

test/Aevatar.EventSourcing.MongoDB.Tests/CompatibilityTests.cs

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

test/Aevatar.EventSourcing.MongoDB.Tests/RealDataCompatibilityTests.cs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -67,27 +67,6 @@ public void OrleansCompatibleGrainSerializer_CanHandleSimpleJsonFormat()
6767
Assert.NotNull(result);
6868
}
6969

70-
[Fact]
71-
public void CompatibleGrainSerializer_CanDeserializeRealMemoryFormat()
72-
{
73-
// Arrange - 使用原始的兼容序列化器测试简单格式
74-
var simpleJson = """
75-
{
76-
"PromptTemplate": "Test prompt template",
77-
"Id": "00000000-0000-0000-0000-000000000000",
78-
"Ctime": "0001-01-01T00:00:00"
79-
}
80-
""";
81-
82-
var bsonString = new BsonString(simpleJson);
83-
var serializer = new CompatibleGrainSerializer();
84-
85-
// Act
86-
var result = serializer.Deserialize<object>(bsonString);
87-
88-
// Assert
89-
Assert.NotNull(result);
90-
}
9170

9271
[Fact]
9372
public void TestComplexTypeDeserialization()

0 commit comments

Comments
 (0)