This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Read | |
//BsonDocument | |
var collection = db.GetCollection<BsonDocument>("people"); | |
var builder = Builders<BsonDocument>.Filter; | |
//Note that the '&' '!' '|' operators are overloaded when used in the FilterBuilder | |
var filter = builder.Lt("Age", 33) & !builder.Eq("Name", "Ericsson"); | |
var list = await collection.Find(filter).ToListAsync(); | |
------------------------------------------------------------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Result | |
{ | |
public bool Success { get; private set; } | |
public string Error { get; private set; } | |
public bool Failure | |
{ | |
get { return !Success; } | |
} |