深入探索Business Connectivity Services(BCS)技术
1. 数据类型与方法创建
在进行业务连接服务相关操作时,需要创建一系列的数据类型描述符和方法。以下是部分关键代码示例:
returnRootCollectionTypeDescriptor.ChildTypeDescriptors.Create(
"Customer", true,
"System.Data.IDataRecord, [full assembly name for System.Data]",
"Customer", null, null, TypeDescriptorFlags.None, null);
returnRootElementTypeDescriptor.ChildTypeDescriptors.Create(
"CustomerId", true, "System.Int32", "CustomerId",
new IdentifierReference("CustomerId",
new EntityReference("MiniCRM", "Customer", catalog), catalog),
null, TypeDescriptorFlags.None, null);
specificFinder.MethodInstances.Create("GetCustomer", true,
returnRootElementTypeDescriptor,