How to convert mongo document into key value pair in .Net?

Published on

There is a ToDictionary method that can map┬áthis. var document = collection.Find(filter).Project(projection); var dictionary = documents.ToEnumerable().ToDictionary(key => key.client, value => value.url); A different approach var docs = new Dictionary<string, BsonDocument>(); var result = collection.Find(filter).Project(projection); result.ForEachAsync((bsonDoc) => { string name = bsonDoc.GetValue(“[Your Dictionary Key]”).AsString; if (!docs.ContainsKey(name)) { docs[name] = bsonDoc;}});

What is the difference between an Web App and Web Role in Azure

Published on

Web Roles give you several features beyond Web Apps (formerly Web Sites): Ability to run elevated startup scripts to install apps, modify registry settings, install performance counters, fine-tune IIS, etc. Ability to split an app up into tiers (maybe Web Role for front end, Worker Role for backend processing) and scale independently Ability to RDP … Continue reading What is the difference between an Web App and Web Role in Azure