我的情况是: 1.我有EF通过模型设计师生成的实体模型。 数据库也是由EF通过模型设计者生成的。 2.所有实体'属性分别映射到DB列。 对于例如我生成的"有问题的"实体是:
[EdmEntityTypeAttribute(NamespaceName="MyModel", Name="File")]
[Serializable()]
[DataContractAttribute(IsReference=true)]
public partial class File : ContentItem
{
//some properties
[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
[DataMemberAttribute()]
public global::System.Int32 Major
{
// get and set are here
}
//another properties
}
我需要: 1.使用一个标量属性手动扩展实体(在生成的同一命名空间中创建部分类); 我做了什么:
public partial class File
{
[DataMemberAttribute()]
public double ContextWeight { get; set; }
}
问题: 当我构建服务项目然后在客户端(代理)项目中更新服务引用时,那么在客户端(代理)上我不会看到File类中存在的这个新属性。
注意:我不需要" ContextWeight"属性映射到任何数据库列。
你能告诉我应该添加什么(可能缺少某些属性或其他什么)?