【发布时间】:2012-01-20 09:36:46
【问题描述】:
我将 ASP.NET MVC4(EF 代码优先)与 WCF ADO.NET 数据服务 2011 年 10 月 CTP 结合使用。我有一个问题 - 我不知道如何忽略敏感属性(如电子邮件)。
我尝试使用 ADO.NET 实体数据模型 (.edmx) 并找到敏感属性的声明:
[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
[DataMemberAttribute()]
public global::System.String MySensitiveProperty
{
get
{
return _MySensitiveProperty;
}
并更改吸气剂:
[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
[DataMemberAttribute()]
public global::System.String MySensitiveProperty
{
get
{
return "No data here!";
}
对于我的问题有更好更简单的解决方案吗?
【问题讨论】:
标签: entity-framework-4 properties wcf-data-services