我刚刚将 ServiceStack 配置为在本地使用 Mongodb 进行身份验证
public override void Configure(Container container)
{
Plugins.Add(new AuthFeature(()=> new AuthUserSession(), new IAuthProvider[]{new BasicAuthProvider(), }));
var mongoClient = new MongoClient("mongodb://localhost");
var server = mongoClient.GetServer();
var db = server.GetDatabase("letters");
container.Register<ICacheClient>(new MemoryCacheClient());
container.Register<IUserAuthRepository>(new MongoDBAuthRepository(db, true));
}
当我启动服务时,出现以下异常: MissingMethodException: Method not found: 'MongoDB.Driver.SafeModeResult MongoDB.Driver.MongoCollection`1.Save(!0)'
这是提供程序中的错误还是我缺少使用提供程序的东西?