保存代码:UserInfo user = new UserInfo();
user.user_id = 5;
user.user_name = "a";
DbEntry.Save(user);对象模型: public class UserInfo : DbObject
{
[DbKey(IsDbGenerate = false)]
public int user_id;
public string user_name;
}
在DbEntry.Save(user); 的时候抛出 “Multiple key do not allow SystemGeneration!” 异常
user.user_id = 5;
user.user_name = "a";
DbEntry.Save(user);对象模型: public class UserInfo : DbObject
{
[DbKey(IsDbGenerate = false)]
public int user_id;
public string user_name;
}
在DbEntry.Save(user); 的时候抛出 “Multiple key do not allow SystemGeneration!” 异常
public class UserInfo : DbObject 应该继承IDbObject接口,因为DbObject类中本身就定义了一个主键