C# Get properties from SettingsPropertyCollection - c#

I have profile provider in my web.config
<profile defaultProvider="MyProvider">
<providers>
.......
<properties>
<add name="CustomField1" type="string" />
<add name="CustomField2" type="string" />
<add name="CustomField3" type="string" />
<add name="CustomField4" type="string" />
</properties>
</profile>
How can I get string[] array containing all avaliable properties (CustomField1, CustomField2....)
Edit:
Found working solution but not sure if it's the best and easiest one.
var allCustomProperties =
profile.GetType().GetProperties().Where(l => l.PropertyType.Name == "String" && l.CanWrite == true).Select(
l => l.Name).ToArray();

I'd go with that:
string[] props = ProfileBase.Properties.Cast<SettingsProperty>()
.Select( p => p.Name ).ToArray();
You have to import both System.Web.Profile and System.Configuration namespaces.

Related

Map foreign key to scalar property

I have 2 tables: Data and AdditionalData. Their relation is 1 to 1-0 (any Data can have 0 or 1 AdditionalData).
For main context I have classes:
class Data
{
public long Id {get;set;} // PK
public string Name {get;set;}
public AdditionalData AdditionalData {get;set;} // can be null
}
class AdditionalData
{
public long Id {get;set;} // PK
public string AdditionalName {get;set;}
}
This works fine.
For another context I just need to know, whether Data has AdditionalData or not:
class ExtendedData
{
public long Id {get;set;} //PK
public string Name {get;set;}
public bool HasAdditionalData {get;set;}
}
I can map it to view:
SELECT
d.*
,IIF(ad.Id IS NULL, 0, 1) AS HasAdditionalData
FROM Data AS d
LEFT OUTER JOIN AdditionalData AS ad ON d.Id = ad.Id
But I want to know:
Can I map ExtendedData class to tables without additional view?
A query like the one below might be what you are looking for, if you are ok with just using ExtendedData as the result of a projection:
var result = ctx.Data.Select(d => new ExtendedData {Id = d.Id, Name = d.Name, HasAdditionalData = d.ApprovalStatus != null);
The problem is that your PK is playing double duty as FK also, had you defined the FK for AdditionalData as another field, nullable AdditionalDataId perhaps, then checking for the existence of AdditionalData would be trivial; just check if AdditionalDataId is null, and you would get better performance also.
You could avoid creation of database view with DefiningQuery construct. DefiningQuery provides the same functionality as database view, but it's defined in your model, not in the database itself.
You can't create DefiningQuery with Visual Studio Model Designer though, you should manually edit your edmx file. At first add EntityType and EntitySet definitions to SSDL layer:
<!-- SSDL content -->
<edmx:StorageModels>
<Schema Namespace="TestDataModel.Store" Provider="System.Data.SqlClient" ProviderManifestToken="2012" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
<EntityType Name="ExtendedData">
<Key>
<PropertyRef Name="Id" />
</Key>
<Property Name="Id" Type="bigint" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="Name" Type="nvarchar(max)" Nullable="false" />
<Property Name="HasAdditionalData" Type="bit" Nullable="false" />
</EntityType>
<EntityContainer Name="TestDataModelStoreContainer">
<EntitySet Name="ExtendedData" EntityType="Self.ExtendedData" store:Type="Views" store:Schema="dbo" store:Name="ExtendedData">
<DefiningQuery>
SELECT d.Id, d.Name, CAST(IIF(ad.Id IS NULL, 0, 1) AS BIT) AS HasAdditionalData
FROM Data AS d
LEFT OUTER JOIN AdditionalData AS ad ON d.Id = ad.Id
</DefiningQuery>
</EntitySet>
</EntityContainer>
</Schema></edmx:StorageModels>
Note that your View query is specified under DefiningQuery element with slight changes.
Then you should add ExtendedData entity to CSDL. This could be done with further manual editing of edmx or with Model Designer. Here how it looks finally:
<!-- CSDL content -->
<edmx:ConceptualModels>
<Schema Namespace="TestDataModel" Alias="Self" annotation:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
<EntityContainer Name="TestDataEntities2" annotation:LazyLoadingEnabled="true">
<EntitySet Name="ExtendedDatas" EntityType="TestDataModel.ExtendedData" />
</EntityContainer>
<EntityType Name="ExtendedData">
<Key>
<PropertyRef Name="Id" />
</Key>
<Property Name="Id" Type="Int64" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="Name" Type="String" Nullable="false" />
<Property Name="HasAdditionalData" Type="Boolean" Nullable="false" />
</EntityType>
</Schema>
</edmx:ConceptualModels>
Then you should add CSDL-SSDL mapping, again manually editing edmx or through Table Mapping:
<!-- C-S mapping content -->
<edmx:Mappings>
<Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2009/11/mapping/cs">
<EntityContainerMapping StorageEntityContainer="TestDataModelStoreContainer" CdmEntityContainer="TestDataEntities2">
<EntitySetMapping Name="ExtendedDatas">
<EntityTypeMapping TypeName="IsTypeOf(TestDataModel.ExtendedData)">
<MappingFragment StoreEntitySet="ExtendedData">
<ScalarProperty Name="HasAdditionalData" ColumnName="HasAdditionalData" />
<ScalarProperty Name="Name" ColumnName="Name" />
<ScalarProperty Name="Id" ColumnName="Id" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
</EntityContainerMapping>
</Mapping>
</edmx:Mappings>
Be careful: Any manual changes in SSDL part of your edmx will be lost if you update your model from the database.

Updating a config file in c#

I am creating an update to my companies system that will be running on several clients and I have two config files, the old config file and the newer version.
Is there any way that I can compare the both files and check the differences to add to the older file what I have new in the first one?
Keep in mind that the files may have different info and the only thing that I need to add/change is the keys. For example, if a key is different change the older to that new "version", if a key doesn’t exist in the older files add it.
they keys will have the exact same name but may have different values. Plus there could be a new key that doesnt exist in the older file and I need to add it
I will leave an example of the files for you to see,
Any help would be appreciated.
<configuration>
<appSettings>
<add key="ORCASRV1" value="ORCA30|tcp://127.0.0.1:9001" />
<add key="ORCASRV2" value="REORCA30|tcp://127.0.0.1:9001" />
<add key="ServidorEmail" value="xxx" />
<add key="SqlTrans" value="1" />
<add key="RemoteType" value="0" />
<add key="LocalPort" value="9002" />
<add key="LocalMsgStore" value="1" />
<add key="sqlCHAR_TO_DATA" value="CONVERT(datetime, '#MM#/#DD#/#YYYY#')" />
<add key="sqlDATA_TO_CHAR" value="CONVERT(char(30), #CAMPO#)" />
<add key="sqlDATAPARTE" value="LTRIM(STR(DATEPART(#PARTE, #CAMPO#)))" />
<add key="sqlNUM_TO_CHAR" value="LTRIM(STR(#VALOR#))" />
<add key="sqlSYSDATE" value=" GetDate() " />
<add key="sqlALIAS" value=" As " />
<add key="sqlCONCATENAR" value="+" /> <add key="sqlNULL" value="IsNull(#CAMPO#,#VALOR#)" />
<add key="sqlROUND" value="ROUND(#CAMPO#,#PARTE#)" />
<add key="sqlLPAD" value="RIGTH(REPLICATE('#CHAR#',#VEZES#)+#CAMPO#,#VEZES#)" />
<add key="oraCHAR_TO_DATA" value="TO_DATE('#MM#/#DD#/#YYYY#','MM/DD/YYYY')" />
<add key="oraDATA_TO_CHAR" value="TO_CHAR(#CAMPO#, 'DD/MM/YYYY')" />
<add key="oraDATAPARTE" value="TO_CHAR(#PARTE#, #CAMPO#)" />
<add key="oraNUM_TO_CHAR" value="TO_CHAR(#VALOR#)" />
<add key="oraSYSDATE" value=" SYSDATE " />
<add key="oraALIAS" value=" " />
<add key="oraCONCATENAR" value="||" />
<add key="oraNULL" value="NVL(#CAMPO#,#VALOR#)" />
<add key="oraROUND" value="ROUND(#CAMPO#,#PARTE#)" />
<add key="oraLPAD" value="LPAD(#CAMPO#,#VEZES#,#CHAR#)" />
<add key="EmailCDP" value="antonio.santos#cdp-si.pt" />
<add key="EmailCliente" value="xxx" />
<add key="RPT_PATH1" value="C:\PROD\ORCAREPORT\" />
<add key="StartPage_Height" value="90" />
<add key="StartPage_Margem" value="220" />
<add key="StartPage_Espaco" value="5" />
<add key="StartPage_Intervalo" value="2" />
<add key="StartPage_Mais" value="35" />
<add key="HelpExec" value="WINHLP32.EXE" />
<add key="HelpFile" value="ORCA.HLP" />
<add key="LogLevel" value="0" />
<add key="LogSqlClient" value="0" />
<add key="LogFile" value="C:\cdpsi\logs" />
</appSettings>
<system.runtime.remoting>
<application>
<channels>
<channel ref="tcp" port="9002">
<clientProviders>
<formatter ref="binary" /> <provider type="CdpCompress.CompressionClientSinkProvider, CdpCompress" />
</clientProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>
Code went like this and it works like a charm:
public void UpdateService(string FilePathOld, string FilePathNew, string LatestVersion)
{
Dictionary<string, string> Old = new Dictionary<string, string>();
Dictionary<string, string> New = new Dictionary<string, string>();
if (ExisteFicheiro(FilePathNew) == true && ExisteFicheiro(FilePathOld) == true)
{
ExeConfigurationFileMap configOld = new ExeConfigurationFileMap();
configOld.ExeConfigFilename = FilePathOld;
Configuration config = ConfigurationManager.OpenMappedExeConfiguration(configOld, ConfigurationUserLevel.None);
ExeConfigurationFileMap configNew = new ExeConfigurationFileMap();
configNew.ExeConfigFilename = FilePathNew;
Configuration config2 = ConfigurationManager.OpenMappedExeConfiguration(configNew, ConfigurationUserLevel.None);
KeyValueConfigurationCollection settings = config.AppSettings.Settings;
Old = settings.AllKeys.ToDictionary(key => key, key => settings[key].Value);
KeyValueConfigurationCollection settings2 = config2.AppSettings.Settings;
New = settings2.AllKeys.ToDictionary(key => key, key => settings2[key].Value);
foreach (var NewKey in New)
{
string value;
if (Old.TryGetValue(NewKey.Key, out value))
{
if (value != NewKey.Value)
{
//if (ExistsKey(NewKey.Key, false) == true)
Old[NewKey.Key] = NewKey.Value;
}
}
else
{
Old.Add(NewKey.Key, NewKey.Value);
}
}
foreach (var NewKey in Old)
{
string key = NewKey.Key;
string value = NewKey.Value;
if (config.AppSettings.Settings[key] != null)
{
config.AppSettings.Settings[key].Value = value;
if (key == "Version")
config.AppSettings.Settings[key].Value = LatestVersion;
}
else
{
config.AppSettings.Settings.Add(key, value);
}
if (config.AppSettings.Settings["Version"] == null)
{
config.AppSettings.Settings.Add("Version", LatestVersion);
}
}
config.Save();
}
else
{
Erro NovoErro = new Erro();
Global.Erro = "O ficheiro \"OrcaService.exe.config\" ou o ficheiro \"Orca.exe.config\" não existem nos caminhos especificados!";
}
}

Complex Type not found

So, I included a Stored Proc in my EF ORM. I added the SP to EF by doing Import Function. I chose to create a Complex Type from the SP columns, FolderColumn. After selecting Run Custom Tool the SP was added to my entity's context cs file:
public virtual ObjectResult<FolderColumn> GetColumnFolderModel(Nullable<long> caseid, Nullable<long> folderid, Nullable<long> userid)
{
var caseidParameter = caseid.HasValue ?
new ObjectParameter("caseid", caseid) :
new ObjectParameter("caseid", typeof(long));
var folderidParameter = folderid.HasValue ?
new ObjectParameter("folderid", folderid) :
new ObjectParameter("folderid", typeof(long));
var useridParameter = userid.HasValue ?
new ObjectParameter("userid", userid) :
new ObjectParameter("userid", typeof(long));
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<FolderColumn>("GetColumnFolderModel", caseidParameter, folderidParameter, useridParameter);
}
I see the entity in the Context Model:
And editing my Context.edmx with the XML editor I found:
<ComplexType Name="FolderColumn">
<Property Type="Int64" Name="id" Nullable="false" />
<Property Type="String" Name="Display" Nullable="false" MaxLength="256" />
<Property Type="String" Name="Name" Nullable="false" MaxLength="256" />
<Property Type="String" Name="Width" Nullable="true" MaxLength="12" />
<Property Type="Boolean" Name="Sortable" Nullable="true" />
<Property Type="String" Name="Align" Nullable="true" MaxLength="48" />
<Property Type="Boolean" Name="Hide" Nullable="true" />
</ComplexType>
under the <Schema> tag, along with my common Entity Types.
What I don't see is the Complex Type, FolderColumn in the Context.cs. And, more importantly, the Complex Type is not mapped to the entity, such that I cannot do:
BriefcaseEntities context = new BriefcaseEntities();
context.FolderColumn // <--- Not part of the context
and any reference to FolderColumn throws
The type or namespace name 'FolderColumn' could not be found (are you missing a using directive or an assembly reference?)
Why is my new Complex Type not part of my Context entities?
A Complex Type represents something structured, but not stored. Entities are all stored in tables; Complex Types can come back from SPs, views, etc. So it's what I'd expect to see.

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