I have isDeleted
Nullable
property in Profile
class.
Builders<Profile>.Filter.Eq(p => p.IsDeleted, BsonNull.Value)
But the following code raised next compilation error:
Error 11 Cannot convert lambda expression to type
'MongoDB.Driver.FieldDefinition<MongoDB.DataTypes.Profile,MongoDB.Bson.BsonNull>'
because it is not a delegate type
How to implement a null-check ?
If IsDeleted
is nullable, you can just use a simple null
instead of BsonNull.Value
when you query:
Builders<Profile>.Filter.Eq(p => p.IsDeleted, null)