<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Get entities and relations entire definition</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2009 : Get entities and relations entire definition</description>
  <pubDate>Tue, 28 Apr 2026 16:39:41 -700</pubDate>
  <lastBuildDate>Wed, 29 Jul 2009 16:02:31 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=1369</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Get entities and relations entire definition : Thats great, so thank you very...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=5065#5065</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=536" rel="nofollow">ccancelado</a><br /><strong>Subject:</strong> 1369<br /><strong>Posted:</strong> 29-Jul-2009 at 4:02pm<br /><br />Thats great, so thank you very much for all your help.]]>
   </description>
   <pubDate>Wed, 29 Jul 2009 16:02:31 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=5065#5065</guid>
  </item> 
  <item>
   <title>Get entities and relations entire definition : Yes, the ParentColumns and ChildColumns...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=5064#5064</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 1369<br /><strong>Posted:</strong> 29-Jul-2009 at 3:43pm<br /><br />Yes, the ParentColumns and ChildColumns on the EntitytRelation will be in the same order when multiple columns are involved.]]>
   </description>
   <pubDate>Wed, 29 Jul 2009 15:43:41 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=5064#5064</guid>
  </item> 
  <item>
   <title>Get entities and relations entire definition : I cannot include the square brackets....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=5062#5062</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=536" rel="nofollow">ccancelado</a><br /><strong>Subject:</strong> 1369<br /><strong>Posted:</strong> 29-Jul-2009 at 2:05pm<br /><br />I cannot include the square brackets. Well I hope you understand.]]>
   </description>
   <pubDate>Wed, 29 Jul 2009 14:05:18 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=5062#5062</guid>
  </item> 
  <item>
   <title>Get entities and relations entire definition : for (int i=0; i&amp;lt;_PKColumns.length();...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=5061#5061</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=536" rel="nofollow">ccancelado</a><br /><strong>Subject:</strong> 1369<br /><strong>Posted:</strong> 29-Jul-2009 at 2:02pm<br /><br /> for (int i=0; i&lt;_PKColumns.length(); i++)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PKColum = _PKColumns<em><b><em><em></em></em></b><em><em>;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FKColumn = _FKColumn<b><em></em></b><em><b><em></em></b><em><em>;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</em></em></em></em>]]>
   </description>
   <pubDate>Wed, 29 Jul 2009 14:02:16 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=5061#5061</guid>
  </item> 
  <item>
   <title>Get entities and relations entire definition : I&amp;#039;m sorry. I have an error...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=5060#5060</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=536" rel="nofollow">ccancelado</a><br /><strong>Subject:</strong> 1369<br /><strong>Posted:</strong> 29-Jul-2009 at 2:01pm<br /><br />I'm sorry. I have an error in the code posted in the previous post:<br><br>¿Columns have the same order in the two relations arrays? ¿I can do the following?:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i=0; i&lt;_PKColumns.length(); i++)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PKColum = _PKColumns<b><em><em></em></b><em>;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FKColumn = _FKColumn<b><em></em></b><em><b><em></b>;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>Ihave just one relation with two fields, allways when I run the code itlooks like the columns are in order by I would like just to be sure.<br><br>Any help will be appreciated.<br><br>Thanks,<br>C. Cancelado</em></em><br>]]>
   </description>
   <pubDate>Wed, 29 Jul 2009 14:01:45 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=5060#5060</guid>
  </item> 
  <item>
   <title>Get entities and relations entire definition : Hi kimj,It works, thank you very...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=5059#5059</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=536" rel="nofollow">ccancelado</a><br /><strong>Subject:</strong> 1369<br /><strong>Posted:</strong> 29-Jul-2009 at 1:58pm<br /><br />Hi kimj,<br><br>It works, thank you very much. I have just a question, I have include the following code to get the relations:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Reflection.Assembly asm = System.Reflection.Assembly.GetAssembly(aPrimReportObject.ObjectEntityType);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EntityRelation.InitializeEntityRelations(asm);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // getting all relations accordingly to current type<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; List&lt;EntityRelation&gt; entityRelationList = new List&lt;EntityRelation&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EntityRelation.GetEntityRelations(new Type&#091;&#093; { aPrimReportObject.ObjectEntityType })); <br><br>After I get the columns of the relations:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // processing each relation<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach (EntityRelation oneEntityRelation in entityRelationList)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _PKColumns = oneEntityRelation.ParentColumns;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _FKColumns = oneEntityRelation.ChildColumns;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>As PKColumns and FKColumns are EntityColumns Arrays (<b>EntityColumn&#091;&#093;</b>), I would like to know how can I obtain the columns pair, I mean, if I have a relationship <b>Parent.Id=Child.ParentId and Parent.Code=Child.PatientCode</b> (this is just an example), ParentColumns will have two EntityColumns Id and Code and&nbsp; ChildColumns will have two EntityColumns ParentId and ParentCode, ¿how can I know that the relation Id is with ParentId and Code is with ParentCode?<br><br>¿Relations have the same order in the array? ¿I can do the following?:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i=0; i&lt;_PKColumns.length(); i++)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PKColum = _PKColumns<b><em></b>;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FKColumn = _FKColumn<b><em></b>;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>I have just one relation with two fields, allways when I run the code it looks like the columns are in order by I would like just to be sure.<br><br>Any help will be appreciated.<br><br>Thanks,<br>C. Cancelado<br>]]>
   </description>
   <pubDate>Wed, 29 Jul 2009 13:58:27 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=5059#5059</guid>
  </item> 
  <item>
   <title>Get entities and relations entire definition : OK, instead of using reflection...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=5042#5042</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 1369<br /><strong>Posted:</strong> 27-Jul-2009 at 12:17pm<br /><br />OK, instead of using reflection use the static methods on EntityRelation.&nbsp; First make sure that relations are loaded.<DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp; // Do 1 time for the assembly.</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EntityRelation.InitializeEntityRelations(asm);</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // for each type, return the relations<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var rels = EntityRelation.GetEntityRelations(new Type&#091;&#093; { TypeInModel });<BR></DIV>]]>
   </description>
   <pubDate>Mon, 27 Jul 2009 12:17:37 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=5042#5042</guid>
  </item> 
  <item>
   <title>Get entities and relations entire definition : Off course, thanks.I have a class...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=5041#5041</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=536" rel="nofollow">ccancelado</a><br /><strong>Subject:</strong> 1369<br /><strong>Posted:</strong> 27-Jul-2009 at 11:16am<br /><br />Off course, thanks.<br><br>I have a class <b>EntitiesManager </b>with the following code:<b><br><br></b>&nbsp;public class EntitiesManager<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public List&lt;ReportDataObject&gt; GetAvailableEntitiesList(BusinessModel aBusinessModel)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; List&lt;ReportDataObject&gt; AvailableObjects = new List&lt;ReportDataObject&gt;();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>Type&#091;&#093; typesInModel = IdeaBlade.Util.ReflectionFns.GetTypesImplementing(typeof(Entity), new string&#091;&#093; {aBusinessModel.AssemblyName});</b><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type&#091;&#093; er = IdeaBlade.Util.ReflectionFns.GetTypesImplementing(typeof(EntityRelations), new string&#091;&#093; { aBusinessModel.AssemblyName });<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //List&lt;FieldInfo&gt; relations = er.GetFields().Where(f =&gt; f.FieldType == typeof(EntityRelation)).ToList();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach (Type TypeInModel in typesInModel)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (TypeInModel.BaseType != typeof(Entity))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EntityTypeInfo TheEntityTypeInfo = EntityTypeInfo.GetByType(TypeInModel);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RdbTableMappingInfo TheTableMappingInfo = (RdbTableMappingInfo)(TheEntityTypeInfo.PrototypeEntityTable.TableMappingInfo);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string tmpTableName = TheTableMappingInfo.SourceTableName;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ReportDataObject aReportDataObject = new ReportDataObject();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aReportDataObject.BusinessObjectName = TheEntityTypeInfo.EntityType.Name;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aReportDataObject.TableName = tmpTableName.Substring(tmpTableName.IndexOf(':')+1);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aReportDataObject.ObjectEntityType = TypeInModel;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AvailableObjects.Add(aReportDataObject);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Data.Common.DataColumnMappingCollection ColumnsMappings = TheTableMappingInfo.ColumnMappings;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; List&lt;ReportDataObjectField&gt; AvailableObjectColumns = new List&lt;ReportDataObjectField&gt;();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; List&lt;EntityColumn&gt; columns = new List&lt;EntityColumn&gt;();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach (EntityColumn column in EntityColumn.GetEntityColumns(TypeInModel))<br>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p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ReportDataObjectField aReportDataObjectField = new ReportDataObjectField();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aReportDataObjectField.BusinessObjectFieldName = column.ColumnName;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aReportDataObjectField.TableFieldName = tmpColumnName;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aReportDataObjectField.ShowInReport = true;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aReportDataObjectField.FieldType = column.DataType;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aReportDataObjectField.ReportDataObject = aReportDataObject;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AvailableObjectColumns.Add(aReportDataObjectField);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; columns.Add(column);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aReportDataObject.ReportDataObjectFields = AvailableObjectColumns;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return AvailableObjects;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br><br>The GetAvailableEntities is called by a method that stores the result in a list and fills a DataSource in order to fill a Grid:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private void LoadFieldLists()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SelectedBusinessModel = (BusinessModel)ModelsList.SelectedItem;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (SelectedBusinessModel != null)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; availableTypesList = anEntitiesManager.GetAvailableEntitiesList(SelectedBusinessModel);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; availableTypesList = new List&lt;ABELSoft.AdHocReports.DynamicReports.ReportDataObject&gt;();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AvailableTypesBS.DataSource = availableTypesList;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SelectedTypesBS.DataSource = selectedTypesList;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SimpleFormulaFieldsBS.DataSource = simpleFormulasList;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ArrayFormulaFieldsBS.DataSource = groupingFormulasList;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>Tell me if you need more information. Thank you very much.<br>C. Cancelado<br>]]>
   </description>
   <pubDate>Mon, 27 Jul 2009 11:16:06 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=5041#5041</guid>
  </item> 
  <item>
   <title>Get entities and relations entire definition : You can post your code here if...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=5040#5040</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 1369<br /><strong>Posted:</strong> 27-Jul-2009 at 10:56am<br /><br /><P>You can post your code here if you like and we'll see what's going on.&nbsp; </P><DIV>Also, take a look at the static methods on the EntityRelation class like GetEntityRelations(Type).</DIV>]]>
   </description>
   <pubDate>Mon, 27 Jul 2009 10:56:12 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=5040#5040</guid>
  </item> 
  <item>
   <title>Get entities and relations entire definition : Hi Kimj,I&amp;#039;m sorry but it...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=5038#5038</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=536" rel="nofollow">ccancelado</a><br /><strong>Subject:</strong> 1369<br /><strong>Posted:</strong> 27-Jul-2009 at 3:37am<br /><br />Hi Kimj,<br><br>I'm sorry but it does not work. I'm using just an assembly each time, I'm not iterating through assemblies. I do not understand why the same code works for get the entities but not for get the relations.<br><br>I have really test all the posibilities but anything works. I just need to get the relations of an entity, I would like to get the information of an entity like <b>IdeaBlade Object Mapper</b> makes to construct the definitions. Is it possible?<br><br>Thanks,<br>C. Cancelado<br>]]>
   </description>
   <pubDate>Mon, 27 Jul 2009 03:37:05 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=5038#5038</guid>
  </item> 
  <item>
   <title>Get entities and relations entire definition : Maybe the assembly you are looking...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=4987#4987</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 1369<br /><strong>Posted:</strong> 20-Jul-2009 at 2:59pm<br /><br />Maybe the assembly you are looking at does not have an EntityRelations class defined within it.&nbsp; If you are iterating through a number of assemblies, not all of which may have this type, then don't use the First() method.&nbsp; Once you find an EntityRelations type in an assembly, there will be 0 or more static fields of type EntityRelation.]]>
   </description>
   <pubDate>Mon, 20 Jul 2009 14:59:05 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=4987#4987</guid>
  </item> 
  <item>
   <title>Get entities and relations entire definition : Hi Kimj.I try this code but it...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=4977#4977</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=536" rel="nofollow">ccancelado</a><br /><strong>Subject:</strong> 1369<br /><strong>Posted:</strong> 19-Jul-2009 at 10:38am<br /><br />Hi Kimj.<br><br>I try this code but it does not work. It returns an array with dimensions 0, I means it returns an empty array. Regading relations definitions, I think that it does not work because the relations are not implementing the EntityRelations interface.<br><br>Do you have another idea?<br><br>Please I need trly help on that.<br>]]>
   </description>
   <pubDate>Sun, 19 Jul 2009 10:38:01 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=4977#4977</guid>
  </item> 
  <item>
   <title>Get entities and relations entire definition : You can get the relations using...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=4935#4935</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 1369<br /><strong>Posted:</strong> 10-Jul-2009 at 11:12am<br /><br />You can get the relations using reflection also.&nbsp; Something like this - <DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type er = ReflectionFns.GetTypesImplementing(typeof(EntityRelations), asm).First();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; List&lt;FieldInfo&gt; relations = er.GetFields().Where(f =&gt; f.FieldType == typeof(EntityRelation)).ToList();<BR></DIV><DIV>(The Where clause is actually unnecessary since only EntityRelation fields are auto-generated into the EntityRelations class.)</DIV>]]>
   </description>
   <pubDate>Fri, 10 Jul 2009 11:12:56 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=4935#4935</guid>
  </item> 
  <item>
   <title>Get entities and relations entire definition : Hi, I need to implement a tool...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=4923#4923</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=536" rel="nofollow">ccancelado</a><br /><strong>Subject:</strong> 1369<br /><strong>Posted:</strong> 08-Jul-2009 at 1:53pm<br /><br />Hi, I need to implement a tool to allow the user to selectthe Entities in a business model to generate a dynamic query. <br>I'm usingthe <b>IdeaBlade.Util.ReflectionFns.GetTypesImplementing</b> method toobtain the entities but I'm having problems to get the entitiesrelations. <br>I'm trying to use <b>EntityRelation.GetRelations()</b>, but how canI change/select the Assembly to search the relations. <br><br>Any help will be appreciated. Thanks,<br>C.Cancelado]]>
   </description>
   <pubDate>Wed, 08 Jul 2009 13:53:42 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1369&amp;PID=4923#4923</guid>
  </item> 
 </channel>
</rss>