Microsoft Office Tutorials and References
In Depth Information
C:\Windows\Microsoft.net\assembly\GaC_MsiL\Microsoft.sharepoint.BusinessData.
administration.Client\v4.0_15.0.0.0__71e9bce111e9429c\Microsoft.sharepoint.BusinessData.
administration.Client.dll
system.Web
replace the code in program.cs with that of Listing 4-8. ensure that you change the sharepoint site urL correctly
to your own. also, if the method names, eCt name, or namespace are different, make sure to change them
accordingly in the code.
Listing 4-8. Code for the BDC Runtime
using System;
using Microsoft.SharePoint;
using Microsoft.SharePoint.BusinessData.SharedService;
using Microsoft.SharePoint.BusinessData.MetadataModel;
using Microsoft.BusinessData.MetadataModel;
using Microsoft.BusinessData.Runtime;
namespace BCSRunTime // Set namespace according to your project
{
class Program // Set class name as per your project
{
static void Main(string[] args)
{
ExecuteBcsEctMethods(@" http://localhost:81/ " ); // set your site URL
}
static void ExecuteBcsEctMethods(string siteUrl)
{
using (SPSite site = new SPSite(siteUrl))
{
using (new SPServiceContextScope(SPServiceContext.GetContext(site)))
{
BdcServiceApplicationProxy proxy =
(BdcServiceApplicationProxy)SPServiceContext.Current.GetDefaultProxy(
typeof(BdcServiceApplicationProxy));
DatabaseBackedMetadataCatalog model =
proxy.GetDatabaseBackedMetadataCatalog();
// Namespace, Entity name
IEntity entity = model.GetEntity("EmployeeEntityModel.BdcModel1",
"Entity1");
ILobSystemInstance lobSystemInstance =
entity.GetLobSystem().GetLobSystemInstances()[0].Value;
// Finder method name
IMethodInstance method = entity.GetMethodInstance("ReadList",
MethodInstanceType.Finder);
IView view = entity.GetFinderView(method.Name);
IFilterCollection filterCollection = entity.GetDefaultFinderFilters();
IEntityInstanceEnumerator entityInstanceEnumerator =
 
Search JabSto ::




Custom Search