我正在使用 VS 2010 和 LinqToSql。当我将视图拖到图表上并设置我的关系时,XML 会更新,但类不会使用支持的方法和属性进行更新。
在我完成此操作之前,我会得到这样的属性:
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Question_QuestionAggregatesView", Storage="_QuestionAggregatesView", ThisKey="Id", OtherKey="Id", IsUnique=true, IsForeignKey=false)]
[global::System.Runtime.Serialization.DataMemberAttribute(Order=38, EmitDefaultValue=false)]
public QuestionAggregatesView QuestionAggregates
{
get
{
if ((this.serializing
&& (this._QuestionAggregatesView.HasLoadedOrAssignedValue == false)))
{
return null;
}
return this._QuestionAggregatesView.Entity;
}
set
{
QuestionAggregatesView previousValue = this._QuestionAggregatesView.Entity;
if (((previousValue != value)
|| (this._QuestionAggregatesView.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._QuestionAggregatesView.Entity = null;
previousValue.Question = null;
}
this._QuestionAggregatesView.Entity = value;
if ((value != null))
{
value.Question = this;
}
this.SendPropertyChanged("QuestionAggregates");
}
}
}
但是 LinqToSql 并没有为我新添加的视图创建这种类型的属性。
这是VS2010中的错误还是我做错了什么?
非常感谢!!