createState方法无法正常工作。
using MongoDB.Entities;
using System.Threading.Tasks;
namespace TestApp
{
public class ApiUsers : Entity
{
public string UserEMail { get; set; }
}
internal static class Program
{
private static async Task Main()
{
await DB.InitAsync("test", "localhost");
await new[] {
new ApiUsers { UserEMail = "test@test.com"},
new ApiUsers { UserEMail = "test@test.com"},
new ApiUsers { UserEMail = "test@test.com"},
new ApiUsers { UserEMail = "teX@teX.com"},
}.SaveAsync();
var idToKeep = (await DB.Find<ApiUsers, string>()
.Match(u => u.UserEMail == "test@test.com")
.Project(u => u.ID)
.Limit(1)
.ExecuteAsync())[0];
await DB.DeleteAsync<ApiUsers>(
u => u.UserEMail == "test@test.com" &&
u.ID != idToKeep);
}
}
}
显示此错误 [1]:https://i.stack.imgur.com/An0iV.png