代码段:实现 Disassociator
上次修改时间: 2010年4月19日
适用范围: SharePoint Server 2010
本文内容
.NET 连接程序集的示例
ASP.NET Web 服务的示例
WCF 服务的示例
下面的代码示例演示如何在 .NET 连接程序集和 Web 服务中实现 Disassociator 方法实例。
.NET 连接程序集的示例
public void DisassociatorCustomerRegion(String customerid, String regionid)
{
CustomerRegion custreg = customerregions.Find(
cr => cr.CustomerID == customerid && cr.RegionID == regionid);
if (custreg != null)
customerregions.Remove(custreg);
return;
}
ASP.NET Web 服务的示例
[WebMethod]
public void DisassociatorCustomerRegion(String customerid, String regionid)
{
CustomerRegion custreg = customerregions.Find(
cr => cr.CustomerID == customerid && cr.RegionID == regionid);
if (custreg != null)
customerregions.Remove(custreg);
return;
}
WCF 服务的示例
下面的代码演示服务约定接口中的操作定义。
[OperationContract]
void DisassociatorCustomerRegion(string customerid, string regionid);
下面的示例演示方法实例的实现。
public void DisassociatorCustomerRegion(String customerid, String regionid)
{
CustomerRegion custreg = customerregions.Find(
cr => cr.CustomerID == customerid && cr.RegionID == regionid);
if (custreg != null)
customerregions.Remove(custreg);
return;
}