在nbear3中
category和article应该是一对多关系。
那么article的添加:
article.categroy = category.find<category>(...);
//需要把category对象赋值给artilce的category。那就需要先根据dropdownlist选择的categoryid把category信息select出来,这样是否太麻烦,而且效率有问题???是否我的理解有错误,还是有其它添加方法。
....
....
[NotNull]
[CustomQuery("{CategoryId}=@CategoryId",LazyLoad = true)]
Category Category
{
get;
set;
}
按照你的回复,我已经测试成功。
================
RelationType 请问是什么意思?
如果我在[CustomQuery("{CategoryId}=@CategoryId",LazyLoad =
true)]里添加RelationType 就会出错