我有这样的如何在MongoDB(c#)中使用Update.Set()和类型列表<>属性?
class RiskAlertSettings
{
public object _id { get; set; }
public string UserName { get; set; }
public List<RiskAlertType> Alert { get; set; }
public string EmailList { get; set; }
public string SMTPClient { get; set; }
public string SMSList { get; set; }
public string SoundType { get; set; }
}
我插入的数据sucessfully.But同时更新我得到错误的类。 我的查询是
riskAlertSettings.Update(Query.EQ("UserName", settings.UserName), Update.Set("Alert",settings.Alert));
我有错误,
The best overloaded method match for 'MongoDB.Driver.Builders.Update.Set(string, MongoDB.Bson.BsonValue)' has some invalid arguments
无法从 'System.Collections.Generic.List' 到 'MongoDB.Bson.BsonValue'
可以在任何帮助的转换这个?