Привязка данных к C# из MongoDB не может прочитать целочисленное значение внутри BsonDocument. ⇐ C#
Привязка данных к 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
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Невозможно получить bsondocument mongodb и преобразовать его в структуру классов в cshapr.
Anonymous » » в форуме C# - 0 Ответы
- 5 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Невозможно получить bsondocument mongodb и преобразовать его в структуру классов в cshapr.
Anonymous » » в форуме C# - 0 Ответы
- 5 Просмотры
-
Последнее сообщение Anonymous
-