0
我刚刚下载了subsonic 3,但是当我尝试编译我的网站时,出现了一些错误。这些错误似乎都与我使用GUID作为外键的情况有关。 一个例子是下面的代码,其中CreatedBy是我的成员资格表的外键。我已经突出显示了受影响的行。Subsonic ActiveRecord由于GUID导致编译失败
public void Add(IDataProvider provider){
**if(String.IsNullOrEmpty(this.CreatedBy))
this.CreatedBy=Environment.UserName;**
var key=KeyValue();
if(key==null){
var newKey=_repo.Add(this,provider);
this.SetKeyValue(newKey);
}else{
_repo.Add(this,provider);
}
SetIsNew(false);
OnSaved();
}
public void Add(string username){
**this.CreatedBy=username;**
Add();
}
public void Add(string username, IDataProvider provider){
**this.CreatedBy=username;**
Add(provider);
}