select value of attribute by linq to xml - c#

in my xml file how i can select the value for attributes TagId in ServiceAssignment elements by linq to xml
Note : this xml in a String Property not in xml file
<AnchoredXml xmlns="urn:schema:Microsoft.Rtc.Management.ScopeFramework.2008" SchemaWriteVersion="1">
<Key ScopeClass="Global">
<SchemaId Namespace="urn:schema:Microsoft.Rtc.Management.Settings.ServiceAssignment.2008" ElementName="ServiceAssignments" />
<AuthorityId Class="Host" InstanceId="00000000-0000-0000-0000-000000000000" />
</Key>
<Dictionary Count="1">
<Item>
<Key />
<Value Signature="2ffb6b0d-0239-4016-b08b-40520d1687ff">
<ServiceAssignments xmlns="urn:schema:Microsoft.Rtc.Management.Settings.ServiceAssignment.2008">
<ServiceAssignment TagId="659550892">
<Component Name="Registrar">
<ServiceId xmlns="urn:schema:Microsoft.Rtc.Management.Deploy.Topology.2008" SiteId="1" RoleName="Registrar" Instance="1" />
</Component>
<Component Name="PresenceFocus">
<ServiceId xmlns="urn:schema:Microsoft.Rtc.Management.Deploy.Topology.2008" SiteId="1" RoleName="UserServices" Instance="1" />
</Component>
</ServiceAssignment>
<ServiceAssignment TagId="911048693">
<Component Name="Registrar">
<ServiceId xmlns="urn:schema:Microsoft.Rtc.Management.Deploy.Topology.2008" SiteId="1" RoleName="Registrar" Instance="2" />
</Component>
<Component Name="PresenceFocus">
<ServiceId xmlns="urn:schema:Microsoft.Rtc.Management.Deploy.Topology.2008" SiteId="1" RoleName="UserServices" Instance="2" />
</Component>
</ServiceAssignment>
</ServiceAssignments>
</Value>
</Item>
</Dictionary>
</AnchoredXml>
i try this code but give me a null exception
var MyList = doc.Root.Elements("ServiceAssignment").Select(c=>c.Attribute(("TagId")).Value).ToList();

You have namespaced elements in the document so you need to include them in your queries.
XNamespace itemNs = "urn:schema:Microsoft.Rtc.Management.ScopeFramework.2008";
XNamespace assignmentNs = "urn:schema:Microsoft.Rtc.Management.Settings.ServiceAssignment.2008";
var query =
from item in doc.Descendants(itemNs + "Item")
from assignment in item.Descendants(assignmentNs + "ServiceAssignment")
select (long)assignment.Attribute("TagId");

string xmlString =
#"<AnchoredXml xmlns='urn:schema:Microsoft.Rtc.Management.ScopeFramework.2008' SchemaWriteVersion='1'>
<Key ScopeClass='Global'>
<SchemaId Namespace='urn:schema:Microsoft.Rtc.Management.Settings.ServiceAssignment.2008' ElementName='ServiceAssignments' />
<AuthorityId Class='Host' InstanceId='00000000-0000-0000-0000-000000000000' />
</Key>
<Dictionary Count='1'>
<Item>
<Key />
<Value Signature='2ffb6b0d-0239-4016-b08b-40520d1687ff'>
<ServiceAssignments xmlns='urn:schema:Microsoft.Rtc.Management.Settings.ServiceAssignment.2008'>
<ServiceAssignment TagId='659550892'>
<Component Name='Registrar'>
<ServiceId xmlns='urn:schema:Microsoft.Rtc.Management.Deploy.Topology.2008' SiteId='1' RoleName='Registrar' Instance='1' />
</Component>
<Component Name='PresenceFocus'>
<ServiceId xmlns='urn:schema:Microsoft.Rtc.Management.Deploy.Topology.2008' SiteId='1' RoleName='UserServices' Instance='1' />
</Component>
</ServiceAssignment>
<ServiceAssignment TagId='911048693'>
<Component Name='Registrar'>
<ServiceId xmlns='urn:schema:Microsoft.Rtc.Management.Deploy.Topology.2008' SiteId='1' RoleName='Registrar' Instance='2' />
</Component>
<Component Name='PresenceFocus'>
<ServiceId xmlns='urn:schema:Microsoft.Rtc.Management.Deploy.Topology.2008' SiteId='1' RoleName='UserServices' Instance='2' />
</Component>
</ServiceAssignment>
</ServiceAssignments>
</Value>
</Item>
</Dictionary>
</AnchoredXml>";
var doc = XDocument.Parse(xmlString);
var TagIds = doc.Descendants()
.Elements()
.Where(e =>
e.HasAttributes &&
e.Name.LocalName.Equals("ServiceAssignment") &&
e.Attribute("TagId") != null)
.Select(e => e.Attribute("TagId").Value);

Your XML contains namespaces, so you can't just compare the full name.
If you don't care about the namespaces, you can use XName.LocalName:
var result = from element in doc.Root.Descendants()
where element.Name.LocalName == "ServiceAssignment"
select (int)element.Attribute("TagId");

You can try with this code
var result = from item in XElement.Load("YourFile.xml").Root.Elements("ServiceAssignment")
where item.Attribute("TagId") == value
select item ;

Related

XML read and getting values

How can I get a this: val="icon.weapon_small_sword_i00"/> from XML file by giving a itemId. I managed to do something like this but besides of choosing right itemId from file I dont know how to get the value I mentioned above.
Thats a code I have:
int ItemId = 15;
XmlTextReader reader = new XmlTextReader(#"D:\L2Eq\xml\items");
XmlNodeType type;
while (reader.Read())
{
type = reader.NodeType;
if (type == XmlNodeType.Element)
{
if (reader.Name == "item")
{
if (Int32.Parse(reader.GetAttribute(0)) == ItemId)
{
Console.WriteLine(reader.GetAttribute(0));
}
}
}
}
And thats how XML file looks like:
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="items.xsd">
<item id="1" type="Weapon" name="Short Sword">
<set name="icon" val="icon.weapon_small_sword_i00" />
<set name="default_action" val="equip" />
<set name="weapon_type" val="sword" />
<set name="bodypart" val="rhand" />
<set name="random_damage" val="10" />
<set name="attack_range" val="40" />
<for>
<set order="0x08" stat="pAtk" val="8" />
<set order="0x08" stat="mAtk" val="6" />
<set order="0x08" stat="rCrit" val="8" />
<set order="0x08" stat="pAtkSpd" val="379" />
</for>
</item>
<item id="2" type="Weapon" name="Long Sword">
<set name="icon" val="icon.weapon_long_sword_i00" />
<set name="default_action" val="equip" />
<set name="weapon_type" val="sword" />
<set name="bodypart" val="rhand" />
<set name="random_damage" val="10" />
<set name="attack_range" val="40" />
<for>
<set order="0x08" stat="pAtk" val="24" />
<set order="0x08" stat="mAtk" val="17" />
<set order="0x08" stat="rCrit" val="8" />
<set order="0x08" stat="pAtkSpd" val="379" />
</for>
</item>
</list>
XmlTextReader is a very clumsy way to deal with XML; I'd never use it. The old System.Xml.XmlDocument API is a much better choice:
var findID = "1";
string iconValue = null;
var xdoc = new System.Xml.XmlDocument();
xdoc.Load(#"D:\L2Eq\xml\items");
iconValue = xdoc.SelectSingleNode("/list/item[#id=" + findID + "]/set[#name='icon']/#val")?.Value;
Or you could use the shiny new LINQ to XML classes:
var doc = XDocument.Load(#"D:\L2Eq\xml\items");
iconValue = doc.Descendants("item")
.Where(d => d.Attribute("id")?.Value == findID)
.Descendants("set")
.Where(x => x.Attribute("name")?.Value == "icon")
.FirstOrDefault()?.Attribute("val")?.Value;

Adding Xml Attribute to All elements except root Node

I am trying to add new attribute to my xml files in c#. my xml file format is shown below:
<Root MessageOfRoot="Welcome to Xml">
<Header Size="36">
<Parameter Name="ID" Index="0" Value="23" />
<Parameter Name="Name" Index="4" Value="Uncle Bob" />
<Parameter Name="Number" Index="8" Value="4" />
</Header>
<Body Size="0">
<Parameter Index="0" UnitNumber="0" Name="UnitBarcode" Type="Integer" />
<Parameter Index="4" PromotionId="0" Name="PromotionalUnit" Type="Integer" />
</Body>
</Root>
I want to add new attribute my xml file which should be like:
<Root MessageOfRoot="Welcome to Xml">
<Header Size="36" NewAttr="1">
<Parameter Name="ID" Index="0" Value="23" NewAttr="1"/>
<Parameter Name="Name" Index="4" Value="Uncle Bob" NewAttr="1"/>
<Parameter Name="Number" Index="8" Value="4" NewAttr="1"/>
</Header>
<Body Size="0" NewAttr="1">
<Parameter Index="0" UnitNumber="0" Name="UnitBarcode" Type="Integer" NewAttr="1"/>
<Parameter Index="4" PromotionId="0" Name="PromotionalUnit" Type="Integer" NewAttr="1"/>
</Body>
</Root>
To do that i write the following code but i am having problem with adding newAttr to all nodes. How can i add NewAttr to my new xml file?
XmlDocument doc = new XmlDocument();
doc.Load("Path of xml");
XmlAttribute NewAttr = doc.CreateAttribute("NewAttr ");
countAttr.Value = "1";
XmlWriter writer = XmlWriter.Create("output.xml", settings);
You can use the following command to load the XML file:
XDocument doc = XDocument.Load(#"C:\Users\myUser\myFile.xml");
Then you can invoke a function that recursively accesses all nodes of the XML starting from the children nodes of the Root element:
AddNewAttribute(doc.Root.Elements());
The function can be like so:
public static void AddNewAttribute(IEnumerable<XElement> elements)
{
foreach (XElement elm in elements)
{
elm.Add(new XAttribute("newAttr", 1));
AddNewAttribute(elm.Elements());
}
}
Finally, you can save the XML back to the original file using:
doc.Save(#"C:\Users\myUser\myFile.xml");

How to parse XML file in c#

I have a XML that has a structure similar to this one:
<?xml version="1.0" encoding="UTF-8"?>
<CompanyName>
<AttrContainer>
<Attr type="String">
<Name value="'Name'" />
<Value value="'AttrContainer'" />
</Attr>
<SubContainer>
<AttrContainer value="'WSSMetadata'" />
<AttrContainer>
<Attr type="String">
<Name value="'Name'" />
<Value value="'AttrContainer'" />
</Attr>
<SubContainer>
<WSSMetadata value="'afe2e194-0ce7-4bfc-b446-9623e4fe7189'" />
<AttrContainer>
<Attr type="String">
<Name value="'Name'" />
<Value value="'WSSMetadata'" />
</Attr>
<Attr type="Uuid">
<Name value="'scanID'" />
<Value value="afe2e194-0ce7-4bfc-b446-9623e4fe7189" />
</Attr>
<Attr type="String">
<Name value="'imagePath'" />
</Attr>
<Attr type="String">
<Name value="'imagePathHD'" />
</Attr>
<Attr type="String">
<Name value="'imagePathThumbnail'" />
</Attr>
<Attr type="String">
<Name value="'imagePathGrey'" />
<Value value="'Images/afe2e194-0ce7-4bfc-b446-9623e4fe7189_grey.jpg'" />
</Attr>
<Attr type="String">
<Name value="'imagePathGreyHD'" />
<Value value="'Images/afe2e194-0ce7-4bfc-b446-9623e4fe7189_grey_hd.jpg'" />
</Attr>
<Attr type="String">
<Name value="'imagePathGreyThumbnail'" />
<Value value="'Images/afe2e194-0ce7-4bfc-b446-9623e4fe7189_grey_thumbnail.jpg'" />
</Attr>
</AttrContainer>
</SubContainer>
</AttrContainer>
</SubContainer>
</AttrContainer>
</CompanyName>
and I am trying to parse it using this code (Linq to XML)
var xmlContent = File.ReadAllText(filePathName);
var doc = XDocument.Parse(xmlContent);
var attr = doc.Root.Elements("CompanyName");
var x = attr.ToList();
but it x has no element.
My questions:
What is wrong with this code that I am not able to get the CompanyName element?
How can I get list of all <SubContainer> elements?
When I got the list of <SubContainer> elements, how can I read read and change its content?
I think you want this instead:
var attr = doc.Root.Elements("AttrContainer");
.Elements returns child elements of that name. CompanyName is you root node, and you're trying to search for its children which are AttrContainer.
What is wrong with this code that I am not able to get the companyname element?
The root element of your xml is CompanyName. So what your code is doing, it's essentially asking 'give me all CompanyName elements that are children of my root CompanyName element'. Hence the list is empty.
how can I get list of all SubContainer elements.
You can use
var subContainers = doc.Root.Descendants("SubContainer");
when I got the list of SubContainer elements, how can I read read and change its content?
foreach (var subContainer in subContainers)
{
foreach (var attrContainer in subContainer.Elements("AttrContainer"))
{
var attr = attrContainer.Elements("Attr").FirstOrDefault();
if (attr != null)
{
var oldValue = attr.Attribute("type").Value;
attr.Attribute("type").Value = "something completely different";
}
}
}
This reads and changes the type on each first Attr element (assuming one exists) in all AttrContainers in all SubContainers - hopefully you can derive something meaningful out of that.
doc.Root returns the element <CompanyName>, so further selecting elements named CompanyName won't return any elements. You're effectively trying to select all <CompanyName> elements that are children of <CompanyName>.
This code will select all <SubContainer> elements no matter their depth. I'm suggesting this because your example XML has several <SubContainer> elements.
// Read all Attr elements
IEnumerable<XElement> subContainerElements = doc.Root.Descendants("SubContainer");
foreach (XElement subContainerElement in subContainerElements)
{
// Work with <SubContainer> element here
}

C# Parsing XML and XElement

I have this code. Also here is a sample of the XML. I apologize for any confusion
<object type="node" >
<property name="id" value="1" />
<property name="name" value="ossvc06_node1" />
<property name="port_id" value="50050768014062AC" />
<property name="port_status" value="active" />
<property name="port_speed" value="4Gb" />
<property name="port_id" value="50050768013062AC" />
<property name="port_status" value="active" />
<property name="port_speed" value="4Gb" />
<property name="port_id" value="50050768011062AC" />
<property name="port_status" value="active" />
<property name="port_speed" value="4Gb" />
<property name="port_id" value="50050768012062AC" />
<property name="port_status" value="active" />
<property name="port_speed" value="4Gb" />
<property name="hardware" value="8G4" />
<property name="iscsi_name" value="iqn.1986-03.com.ibm:2145.ossvc06.ossvc06node1" />
<property name="iscsi_alias" value="" />
<property name="failover_active" value="no" />
<property name="failover_name" value="ossvc06_node2" />
<property name="failover_iscsi_name" value="iqn.1986- .com.ibm:2145.ossvc06.ossvc06node2" />
<property name="failover_iscsi_alias" value="" />
<property name="front_panel_id" value="115286" />
</object>
In the input file there are two of these objects of type "Node" each with different values for the property tags.
In this code I am looking for all the objects of type "node" in the incoming XML. There are 2 of them. The 'var nodes' statement evaluates correctly. In the debugger I can see two XElements with what appears to be the proper type and elements in the element list. However, the statement that gets the elements and assigns them to a list has ChildElements from both of the objects of type "node" that are in the XML and I am not sure why.
//load the input file
XDocument xdoc = XDocument.Load(_InputFile);
//get the object of type 'node'
//this code gives the results expected
// in the debugger each XElement appears to have the proper value and childElements
var nodes = from node in xdoc.Descendants("object")
where node.Attribute("type").Value == "node"
select node;
foreach (XElement nodelement in nodes)
{
// problem happens here, the child elements from both nodes get assigned to the list
List<XElement> nodeles = nodelement.Elements().ToList();
Node node = NodeFactory(nodelement);
// now assign the node to the correct IO group
var iogrp = SVCClusters[0].IOGroups.Where(io => io.Name == node.IOGroupName);
if (iogrp.FirstOrDefault().FirstNode == null) { iogrp.FirstOrDefault().FirstNode = node; }
else { iogrp.FirstOrDefault().SecondNode = node; }
}
Can you run this in a console app and tell me what you get
static void Main(string[] args)
{
XDocument xdoc = XDocument.Parse("<root><object type=\"node\" ><property name=\"id\" value=\"1\" /><property name=\"name\" value=\"ossvc06_node1\" /></object><object type=\"node\" ><property name=\"id\" value=\"2\" /><property name=\"name\" value=\"ossvc06_node2\" /></object></root>");
var nodes = xdoc.Descendants("object").Where(node => node.Attribute("type").Value == "node").ToList();
foreach (XElement nodelement in nodes)
{
List<XElement> nodeles = nodelement.Elements().ToList();
foreach (var node in nodeles)
Console.WriteLine(node);
}
}
You should have 4 rows output to the console
Edit---
Original issue was that an XPath expression "//property[#name='port_id']" was being used. This queries from the document root, not from the current node.
Change the XPath to be either "property[#name='port_id'] or ".//property[#name='port_id']"

How to add "BDC Wildcard Filter" to the ReadList method

Good Morning :)
Situtation: In SP2010, I've a customer list with a external data field. In the solution I have a BDC Model with an entity which contains a "ReadItem" and a "ReadList" method. When I deploy my feature and set the object permissions, I can read the Item without troubles. Now i have to search an item. I follow this instructions to create a Filter: http://msdn.microsoft.com/en-us/library/ee471425.aspx but it doesn't work, because I have always the same value in my parameter ("**") ..
Question:
1. How can I assign the search input to the parameter?
2. Is something other wrong?
Code
public IEnumerable<Oppertunity> ReadList(String inputParameter)
{
using (CRMDataClassesDataContext db = new CRMDataClassesDataContext("server=xxx;database=xxx; uid=xxx ;pwd=xxx"))
{
List<Oppertunity> oppertunities = new List<Oppertunity>();
var q = from c in db.Opportunities
where c.Name.Contains(inputParameter)
orderby c.Name ascending
select new Oppertunity
{
OppertunityId = c.OpportunityId,
Name = c.Name,
};
foreach (var o in q)
{
Oppertunity oppertunity = new Oppertunity();
oppertunity.OppertunityId = o.OppertunityId;
oppertunity.Name = o.Name;
oppertunities.Add(oppertunity);
}
}
return oppertunities;
}
The BDC part looks like the instructions of msdn:
<?xml version="1.0" encoding="utf-8"?>
<Model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/windows/2007/BusinessDataCatalog" Name="BdcModel1">
<LobSystems>
<LobSystem Name="BdcModel1" Type="DotNetAssembly">
<LobSystemInstances>
<LobSystemInstance Name="BdcModel1" />
</LobSystemInstances>
<Entities>
<Properties>
<Property Name="Class" Type="System.String">NX.Intra.Bcs.BdcModel1.ContactService, BdcModel1</Property>
</Properties>
<Identifiers>
<Identifier Name="ContactId" TypeName="System.Guid" />
</Identifiers>
<Methods>
<Method Name="ReadList">
<Parameters>
<Parameter Name="returnParameter" Direction="Return">
<TypeDescriptor Name="ContactList" TypeName="System.Collections.Generic.IEnumerable`1[[NX.Intra.Bcs.BdcModel1.Contact, BdcModel1]]" IsCollection="true">
<TypeDescriptors>
<TypeDescriptor Name="Contact" TypeName="NX.Intra.Bcs.BdcModel1.Contact, BdcModel1">
<TypeDescriptors>
<TypeDescriptor Name="ContactId" TypeName="System.Guid" IdentifierName="ContactId" IsCollection="false" ReadOnly="true">
<Properties>
<Property Name="ShowInPicker" Type="System.Boolean">false</Property>
</Properties></TypeDescriptor>
<TypeDescriptor Name="FirstName" TypeName="System.String">
<Properties>
<Property Name="ShowInPicker" Type="System.Boolean">true</Property>
</Properties>
</TypeDescriptor>
<TypeDescriptor Name="LastName" TypeName="System.String">
<Properties>
<Property Name="ShowInPicker" Type="System.Boolean">true</Property>
</Properties>
</TypeDescriptor>
<TypeDescriptor Name="AccountIdName" TypeName="System.String">
<Properties>
<Property Name="ShowInPicker" Type="System.Boolean">true</Property>
</Properties>
</TypeDescriptor>
<TypeDescriptor Name="FullName" TypeName="System.String">
<Properties>
<Property Name="ShowInPicker" Type="System.Boolean">false</Property>
</Properties>
</TypeDescriptor></TypeDescriptors></TypeDescriptor></TypeDescriptors></TypeDescriptor></Parameter>
</Parameters>
<MethodInstances>
<MethodInstance Name="ReadList" Type="Finder" Default="true" DefaultDisplayName="Read List" ReturnParameterName="returnParameter" />
</MethodInstances></Method>
<Method Name="ReadItem">
<Parameters>
<Parameter Name="returnParameter" Direction="Return">
<TypeDescriptor Name="Contact" TypeName="NX.Intra.Bcs.BdcModel1.Contact, BdcModel1">
<TypeDescriptors>
<TypeDescriptor Name="ContactId" TypeName="System.Guid" IsCollection="false" IdentifierName="ContactId" />
<TypeDescriptor Name="LastName" TypeName="System.String" />
<TypeDescriptor Name="FirstName" TypeName="System.String" />
<TypeDescriptor Name="AccountIdName" TypeName="System.String" />
<TypeDescriptor Name="FullName" TypeName="System.String" /></TypeDescriptors>
</TypeDescriptor>
</Parameter>
<Parameter Name="id" Direction="In">
<TypeDescriptor Name="ContactId" TypeName="System.Guid" IdentifierName="ContactId" IsCollection="false" /></Parameter>
</Parameters>
<MethodInstances>
<MethodInstance Name="ReadItem" Type="SpecificFinder" Default="true" DefaultDisplayName="Read Item" ReturnParameterName="returnParameter" />
</MethodInstances>
</Method>
</Methods></Entity>
<Entity Name="Oppertunity" Namespace="NX.Intra.Bcs.BdcModel1" Version="1.0.0.144">
<Properties>
<Property Name="Class" Type="System.String">NX.Intra.Bcs.BdcModel1.Oppertunity, BdcModel1</Property>
<Property Name="Title" Type="System.String">FirstName</Property>
</Properties>
<Identifiers>
<Identifier Name="OppertunityId" TypeName="System.Guid" />
</Identifiers>
<Methods>
<Method Name="ReadList" IsStatic="false">
<FilterDescriptors>
<FilterDescriptor Name="OppertunityNameFilter" Type="Wildcard" DefaultDisplayName="Suche nach Name" FilterField="Name">
<Properties>
<Property Name="UsedForDisambiguation" Type="System.Boolean">true</Property>
</Properties>
</FilterDescriptor>
</FilterDescriptors>
<Parameters>
<Parameter Name="returnParameter" Direction="Return">
<TypeDescriptor Name="OppertunityList" TypeName="System.Collections.Generic.IEnumerable`1[[NX.Intra.Bcs.BdcModel1.Oppertunity, BdcModel1]]" IsCollection="true">
<TypeDescriptors>
<TypeDescriptor Name="Oppertunity" TypeName="NX.Intra.Bcs.BdcModel1.Oppertunity, BdcModel1">
<TypeDescriptors>
<TypeDescriptor Name="OppertunityId" TypeName="System.Guid" IsCollection="false" IdentifierName="OppertunityId">
<Properties>
<Property Name="ShowInPicker" Type="System.Boolean">false</Property>
</Properties></TypeDescriptor>
<TypeDescriptor Name="Name" TypeName="System.String">
<Properties>
<Property Name="ShowInPicker" Type="System.Boolean">true</Property>
</Properties></TypeDescriptor></TypeDescriptors></TypeDescriptor></TypeDescriptors></TypeDescriptor></Parameter>
<Parameter Name="inputParameter" Direction="In">
<TypeDescriptor Name="OppertunityFinderTD" TypeName="System.String" AssociatedFilter="OppertunityNameFilter">
<TypeDescriptors>
<TypeDescriptor Name="Oppertunity" TypeName="NX.Intra.Bcs.BdcModel1.Oppertunity, BdcModel1">
<TypeDescriptors>
<TypeDescriptor Name="OppertunityId" TypeName="System.Guid" IdentifierName="OppertunityId" IsCollection="false">
<Properties>
<Property Name="ShowInPicker" Type="System.Boolean">false</Property>
</Properties></TypeDescriptor>
<TypeDescriptor Name="Name" TypeName="System.String">
<Properties>
<Property Name="ShowInPicker" Type="System.Boolean">true</Property>
</Properties></TypeDescriptor></TypeDescriptors></TypeDescriptor></TypeDescriptors></TypeDescriptor></Parameter>
</Parameters>
<MethodInstances>
<MethodInstance Name="ReadList" Type="Finder" ReturnParameterName="returnParameter" Default="true" DefaultDisplayName="Read List">
<Properties>
<Property Name="UseClientCachingForSearch" Type="System.String"></Property>
<Property Name="RootFinder" Type="System.String"></Property>
</Properties></MethodInstance>
</MethodInstances></Method>
<Method Name="ReadItem">
<Parameters>
<Parameter Name="returnParameter" Direction="Return">
<TypeDescriptor Name="Oppertunity" TypeName="NX.Intra.Bcs.BdcModel1.Oppertunity, BdcModel1">
<TypeDescriptors>
<TypeDescriptor Name="OppertunityId" TypeName="System.Guid" IdentifierName="OppertunityId" IsCollection="false" />
<TypeDescriptor Name="Name" TypeName="System.String" /></TypeDescriptors></TypeDescriptor>
</Parameter>
<Parameter Name="id" Direction="In">
<TypeDescriptor Name="OppertunityId" TypeName="System.Guid" IdentifierName="OppertunityId" IsCollection="false" /></Parameter>
</Parameters>
<MethodInstances>
<MethodInstance Name="ReadItemList" Type="SpecificFinder" ReturnParameterName="returnParameter" Default="true" DefaultDisplayName="Read Item" />
</MethodInstances></Method>
</Methods></Entity>
</Entities>
</LobSystem>
</LobSystems>
</Model>
Ususally when you use an external list, you can configure value for your filter parameter by editing the default view of a list (or creating new view).
Hope this will help ;-)

Categories