Привязка данных к C# из MongoDB не может прочитать целочисленное значение внутри BsonDocument. ⇐ C#
-
Anonymous
Привязка данных к C# из MongoDB не может прочитать целочисленное значение внутри BsonDocument.
I have collection called transaction like this
{ "approverSpv": { "id": 176, "isApproved": true }, "approverManager": { "id": 176, "isApproved": true } } And I want to read those Approver id. Here are my Classes
public class ApproverManager { public int id { get; set; } public bool isApproved { get; set; } } public class ApproverSpv { public int id { get; set; } public bool isApproved { get; set; } } public class Transaction() { public ApproverSpv approverSpv { get; set; } public ApproverManager approverManager { get; set; } } And then I tried this code from C#
var transactionParts = database.GetCollection("transaction").AsQueryable().ToList(); The code return is always show 0 to every id inside ApproverSpv and ApproverManager but success getting the actual value of isApproved true or false.
May I know, what did I miss here? How to get the actual value of each id inside the Approver?
Источник: https://stackoverflow.com/questions/781 ... of-bsondoc
I have collection called transaction like this
{ "approverSpv": { "id": 176, "isApproved": true }, "approverManager": { "id": 176, "isApproved": true } } And I want to read those Approver id. Here are my Classes
public class ApproverManager { public int id { get; set; } public bool isApproved { get; set; } } public class ApproverSpv { public int id { get; set; } public bool isApproved { get; set; } } public class Transaction() { public ApproverSpv approverSpv { get; set; } public ApproverManager approverManager { get; set; } } And then I tried this code from C#
var transactionParts = database.GetCollection("transaction").AsQueryable().ToList(); The code return is always show 0 to every id inside ApproverSpv and ApproverManager but success getting the actual value of isApproved true or false.
May I know, what did I miss here? How to get the actual value of each id inside the Approver?
Источник: https://stackoverflow.com/questions/781 ... of-bsondoc
Мобильная версия