I've got a custom User class one of its properties is:
[FirestoreProperty(nameof(StatsThisMonth))]
public Dictionary<string, object> StatsThisMonth { get; set; }
When I add a string,int pair to this dictionary, and write to FireStore, there are no problems, and I can see both the string and integer value on FireStore web UI. However, when I read the object back from FireStore, the dictionary items are populated as string,null instead of string,object.
When I do the same with string, string everything works as expect, the dictionary is written to and retrieved from Firestore as expected.
Below is how I am reading the User from the FireStore in case it is relevant:
var snapshot = await CrossFirebaseFirestore.Current.GetCollection("Users")
.WhereEqualsTo(nameof(UserModel.UserId), _firebaseAuth.CurrentUser.Uid)
.GetDocumentsAsync<UserModel>();
Am I doing something wrong? Or could this be a bug?
I've got a custom User class one of its properties is:
When I add a
string,int
pair to this dictionary, and write to FireStore, there are no problems, and I can see both the string and integer value on FireStore web UI. However, when I read the object back from FireStore, the dictionary items are populated asstring,null
instead ofstring,object
.When I do the same with
string, string
everything works as expect, the dictionary is written to and retrieved from Firestore as expected.Below is how I am reading the User from the FireStore in case it is relevant:
Am I doing something wrong? Or could this be a bug?
Many thanks