Vla*_*dak 3 .net c# mongodb mongodb-csharp-2.0 mongodb-.net-driver
我isDeleted Nullable在Profile课堂上有财产.
Builders<Profile>.Filter.Eq(p => p.IsDeleted, BsonNull.Value)
Run Code Online (Sandbox Code Playgroud)
但是下面的代码引发了下一个编译错误:
Error 11 Cannot convert lambda expression to type
'MongoDB.Driver.FieldDefinition<MongoDB.DataTypes.Profile,MongoDB.Bson.BsonNull>'
because it is not a delegate type
Run Code Online (Sandbox Code Playgroud)
如何实现空检查?
如果可以IsDeleted为空,则可以使用简单null而不是BsonNull.Value查询时:
Builders<Profile>.Filter.Eq(p => p.IsDeleted, null)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
970 次 |
| 最近记录: |