Bug:SoftDelete与Index

Apr 27, 2009 at 1:02 AM
[SoftDelete]
public abstract partial class User : LinqObjectModel<User>
{
    [Index(UNIQUE = true)]
    public abstract string Name { set; get; }   
}


public void Test()
{
    User u1 = User.New();
    u1.Name = "a";
    u1.Save();
    u1.Delete();//SoftDelete

    User u2 = User.New();
    u2.Name = "a";
    u2.Save();//数据库级别报错~ 
}
标记了SoftDelete的类,唯一字段的检验被过滤了。
Coordinator
Apr 27, 2009 at 3:34 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Apr 27, 2009 at 3:38 AM
你的这一段代码,数据库级别报错是没有问题的,因为Save函数并不试图执行Verify,只有用户自己或者DbEntryDataSource才会执行Verify,不过,SoftDelete的Verify确实存在你说的问题。
Apr 28, 2009 at 3:07 AM
Edited Apr 28, 2009 at 3:08 AM
呵呵,都忘记是我自己override了Save方法,每次保存都会验证..
感谢:)