4 satır döngü yazmak yerine LINQ ile yeni bir List
(Gerçekte IEnumerable
) oluşturmak istiyorum. LINQ'a bir lambda ifadesi verebileceğimi ve bu ifadeyi kullanarak bir listenin elemanlarını haritalayabileceğimi biliyorum, ancak List
'un türünü değiştirecek mi?LINQ ile birlikte bir differnet türü tutan bir Liste oluşturma?
// My List of objects
List<MyDBDocType> myDBDocs = ...;
// How they are mapped
BsonDocument myDBDocAsBson = myDBDocs[0].ToBsonDocument();
// Function signature that takes a List that holds a separate type
MyDocCollection.InsertManyAsync([IEnumerable<BsonDocument> documents], ...);