Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Carael committed Nov 7, 2024
1 parent d7de919 commit 0893d0d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Migration/MigrationSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ public MigrationSerializer(EntityContext context)
_context = context;
_migrationRunner = new MigrationRunner<T>(context);
_baseSerializer = BsonSerializer.LookupSerializer<T>();

if (_baseSerializer is MigrationSerializer<T>)
{
throw new InvalidOperationException("The base serializer cannot be an instance of MigrationSerializer<T> to prevent recursion.");
}
}

object IBsonSerializer.Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args)
Expand Down

0 comments on commit 0893d0d

Please sign in to comment.