alexandre-spieser / mongodb-generic-repository

An example of generic repository implementation using the MongoDB C# Sharp 2.0 driver (async)
MIT License
311 stars 84 forks source link

Documents don't show up in Azure Cosmos DB data explorer #48

Open pfekrati opened 1 year ago

pfekrati commented 1 year ago

I can't get the docs to show up in CosmosDB. I'm getting this error: "Error querying documents: The GuidRepresentation for the reader is CSharpLegacy, which requires the binary sub type to be UuidLegacy, not UuidStandard"

I tried below code, but it's not working:

public class MongoDbRepository : BaseMongoRepository, IDocumentDbRepository { public MongoDbRepository(string connectionString, string databaseName) : base(connectionString, databaseName) { MongoDbContext.SetGuidRepresentation(MongoDB.Bson.GuidRepresentation.CSharpLegacy); } }