I have the following Model:
Public class UserInfo{
public string Id{get;}
public Dictionary<string, string> Metadata{ get; }
}
When I try to add a new UserInfo to database which has:
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"
as a key name in Metadata to my collection using:
Dbcontext.myCollection.InsertOne(data);
I get the following error message:
MongoDB.Bson.BsonSerializationException: 'Element name 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name' is not valid'.'
I can tell that the issue is the dictionary having a url as a key, because when I removed this key from the dictionary, it worked fine, also when I used this value outside the dictionary it worked fine.
How can I overcome this issue?