【发布时间】:2020-08-08 07:31:15
【问题描述】:
无法将IMongoCollection<MatchDocument> 转换为ObservableCollection<MatchDocument>
MongoClient client = new MongoClient();
var DB = client.GetDatabase("MTR");
var Collection = DB.GetCollection<MatchDocument>("MATCHES");
App.Profiles = new ObservableCollection<MatchDocument>(Collection);
【问题讨论】:
-
您遇到错误了吗?如果是这样,你为什么不告诉我们错误是什么? ObservableCollection 构造函数接受 IEnumerable 或 List,IMongoCollection 是其中之一吗?
-
我的解决方案对您有用吗?如果是,请您接受(点击此答案左上角的☑️),以便我们可以帮助更多有相同问题的人:)。
标签: c# mongodb xamarin.forms type-conversion observablecollection