.net 覆盖WCF数据服务CSDL
我正在处理SharePoint 2010托管的WCF数据服务的一个问题。所以请记住,我仅限于使用.NET3.5。 为了生成CSDL端点来描述我的实体,我使用了适当的装饰器,我享受反射的好处来为我处理这项工作 以下是MEX点的代码:.net 覆盖WCF数据服务CSDL,.net,web-services,sharepoint,wcf-data-services,.net,Web Services,Sharepoint,Wcf Data Services,我正在处理SharePoint 2010托管的WCF数据服务的一个问题。所以请记住,我仅限于使用.NET3.5。 为了生成CSDL端点来描述我的实体,我使用了适当的装饰器,我享受反射的好处来为我处理这项工作 以下是MEX点的代码: [BasicHttpBindingServiceMetadataExchangeEndpoint] [ServiceBehavior(IncludeExceptionDetailInFaults = true)] public class Demarches : Da
[BasicHttpBindingServiceMetadataExchangeEndpoint]
[ServiceBehavior(IncludeExceptionDetailInFaults = true)]
public class Demarches : DataService<CacheDataContext>
{
public static void InitializeService(DataServiceConfiguration config)
{
config.UseVerboseErrors = true;
config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
config.SetServiceOperationAccessRule("*", ServiceOperationRights.AllRead);
config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
}
}
以下是我使用上述代码获得的CSDL文件的一部分:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx">
<edmx:DataServices xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" m:DataServiceVersion="1.0">
<Schema Namespace="XXX.Poco" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://schemas.microsoft.com/ado/2006/04/edm">
<EntityType Name="Demarche">
<Key>
<PropertyRef Name="id" />
</Key>
<Property Name="id" Type="Edm.Int32" Nullable="false" />
<Property Name="titre" Type="Edm.String" Nullable="true" />
<Property Name="avancement" Type="Edm.String" Nullable="true" />
<Property Name="date" Type="Edm.DateTime" Nullable="false" />
<NavigationProperty Name="historiques" Relationship="XXX.Poco.Demarche_historiques" FromRole="Demarche" ToRole="historiques" />
<NavigationProperty Name="proprietes" Relationship="XXX.Poco.Demarche_proprietes" FromRole="Demarche" ToRole="proprietes" />
<Property Name="CacheDurationInSeconds" Type="Edm.Int32" Nullable="false" />
<Property Name="CacheDurationInMinutes" Type="Edm.Int32" Nullable="false" />
<Property Name="CacheDurationInHours" Type="Edm.Int32" Nullable="false" />
</EntityType>
我必须在avancement属性上设置一个标志,因为它是我业务代码中的一个枚举,我想动态地知道,当我读取CSDL端点时,枚举是什么属性,以便在我开发客户端应用程序时提供一个动态过滤系统。
例如,我应该有类似的东西
首先,您知道这种修改是否会破坏某些工具解析,如SvcUtil.exe、Jaydata.exe?
那么,例如,当我初始化Web服务配置时,是否可以通过编程实现这一目标
谢谢你的建议