fix mongo serilaization

This commit is contained in:
Jicheng Lu 2023-10-19 13:15:49 -05:00
parent 5009b97327
commit 931149fc9d
2 changed files with 3 additions and 1 deletions

View file

@ -1,4 +1,3 @@
using BotSharp.Abstraction.Utilities;
using BotSharp.Plugin.MongoStorage.Collections;
namespace BotSharp.Plugin.MongoStorage;

View file

@ -1,4 +1,6 @@
using BotSharp.Plugin.MongoStorage.Repository;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.Serializers;
namespace BotSharp.Plugin.MongoStorage;
@ -17,6 +19,7 @@ public class MongoStoragePlugin : IBotSharpPlugin
if (dbSettings.Default == "MongoRepository")
{
BsonSerializer.RegisterSerializer(new GuidSerializer(GuidRepresentation.Standard));
services.AddScoped((IServiceProvider x) =>
{
var dbSettings = x.GetRequiredService<BotSharpDatabaseSettings>();