Repository.XFRACAS.GetAllXFRACASEntities: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
m (Protected "Repository.GetAllXFRACASEntities" ([edit=sysop] (indefinite) [move=sysop] (indefinite)) [cascading])
No edit summary
 
(18 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Template:APIClass|Repository Class|Repository}}
{{DISPLAYTITLE:Repository.XFRACAS.GetAllXfracasEntities Method}}{{Template:API}}{{Template:APIBreadcrumb|.[[Repository Class|Repository]]}}
Returns an array containing all entity names and and their IDs
== Method Syntax ==
{{APIName|Public Function '''GetAllXFRACASEntities'''()}}
{{APIPrefix|As}}
{{APIName|[[NameIdPair Class|NameIdPair]]()}}<br>
{{APIComment|Returns an array containing all entity names and and their IDs from the current repository.}}


== Usage Example ==
{{APIComment|Code Block}}


'{{APIComment|Declare a new repository connection class.}}
<onlyinclude>Returns an array of '''[[NameIdPair Class|NameIDPair]]''' objects (effectively Dictionaries) that represent the name and ID pairs of the XFRACAS entities in the database.</onlyinclude>
{{APIPrefix|Private WithEvents MyRepository As [[New Repository]]}}
'{{APIComment|Connect to the Synthesis repository.}}
{{APIPrefix|Dim}}Success{{APIPrefix|As Boolean}}={{APIPrefix|False}}
Success = MyRepository.[[Repository.ConnectToRepository|ConnectToRepository]]("RepositoryFileNamePath")
'{{APIComment|Get the list of XFRACAS Entities in the current project in the connected repository.}}
{{APIPrefix|Dim}}ListOfXFRACASEntities() {{APIPrefix|As}} [[NameIdPair Class|NameIdPair]]
ListOfXFRACASEntities = MyRepository.[[Repository.GetAllXFRACASEntities|GetAllXFRACASEntities]]()


== Syntax ==
'''.XFRACAS.GetAllXfracasEntities()'''


== Reformatted Usage Example ==
{{APIComment|Declare a new repository connection class.}}
        Private WithEvents MyRepository As [[New Repository]]


{{APIComment|Connect to the Synthesis repository.}}
== Example ==
        Dim Success As Boolean = False
'''VB.NET'''
        Success = MyRepository.[[Repository.ConnectToRepository|ConnectToRepository]]("RepositoryFileNamePath")
 
{{APIComment|'Connect to a Synthesis enterprise repository.}}
{{APIComment|Get the list of XFRACAS Entities in the current project in the connected repository.}}
  {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
        Dim ListOfXFRACASEntities() As [[NameIdPair Class|NameIdPair]]
  MyRepository.ConnectToSQLRepository({{APIString|"MyServer"}}, {{APIString|"MyDatabase"}})
        ListOfXFRACASEntities = MyRepository.[[Repository.GetAllXFRACASEntities|GetAllXFRACASEntities]]()
 
{{APIComment|'Get a list of all XFRACAS entities.}}  
  {{APIPrefix|Dim}} ListofEntities() {{APIPrefix|As}} NameIDPair
  ListOfEntities = MyRepository.XFRACAS.GetAllXfracasEntities()
{{APIComment|'Output sample: Display the number of elements in the array.}}
  {{APIPrefix|Dim}} NumberofElements {{APIPrefix|As}} Integer
  NumberofElements = UBound(ListofEntities) - LBound(ListofEntities) + 1
  MsgBox (NumberofElements)

Latest revision as of 17:52, 30 November 2017

APIWiki.png


Member of: SynthesisAPI.Repository


Returns an array of NameIDPair objects (effectively Dictionaries) that represent the name and ID pairs of the XFRACAS entities in the database.

Syntax

.XFRACAS.GetAllXfracasEntities()


Example

VB.NET

 'Connect to a Synthesis enterprise repository. 
  Dim MyRepository As New Repository
  MyRepository.ConnectToSQLRepository("MyServer", "MyDatabase")
 
 'Get a list of all XFRACAS entities.  
  Dim ListofEntities() As NameIDPair
  ListOfEntities = MyRepository.XFRACAS.GetAllXfracasEntities()

 'Output sample: Display the number of elements in the array. 
  Dim NumberofElements As Integer
  NumberofElements = UBound(ListofEntities) - LBound(ListofEntities) + 1
  MsgBox (NumberofElements)