MongoDatabaseStateChecker.IsDatabaseOutdated throws an exception

Issue #9 resolved
Raman Vasilyeu created an issue

When i try to check my Db throughout Startup.Configure i have an deserialization exception. I fixed the bug by creation custom serializer for Version field of SpecificationItem. I’ve found you have implemented it, but i don’t see you’ve added it to BsonClassMap.

BsonClassMap.RegisterClassMap<SpecificationItem>(cm =>
{
cm.AutoMap();
cm.GetMemberMap(x => x.Ver)
.SetSerializer(new VerstionSerializer());
});

So pls add it to readme file to help others

I used netstandard2.1

Comments (5)

  1. Raman Vasilyeu reporter

    And maybe rename VerstionSerializerVersionStructSerializer, or smth like this :)

  2. Arthur Osmokiesku repo owner

    Nice catch 👍 it will be fixed in the closes release. Sorry for the extremely long respond.

  3. Arthur Osmokiesku repo owner

    Good afternoon dear Raman,I’ve spent some time on investigation but this issue isn’t reproducible. Several unit test have been added to cover this case. You can check commit b05dcf2 to see how you can use methods IsDatabaseOutdated or ThrowIfDatabaseOutdated. By the way a custom serialiser for version struct is registering in MigrationEngine class which is used under the hood of static MongoDatabaseStateChecker

    Please don’t histate to contact me in case of any difficulties.
    Best regards,
    Artur

  4. Log in to comment