ArcGIS Pro version: 2.5
I have created a filegeodatabase with 2 Feature Classes and 1 Relationship Class with a Table (AttributedRelationshipClass).
The AttributedRelationshipClass defines the link between those two featurelayers using GUIDs and a few properties for the relation.
I used the ArcGis Pro sdk (c#) to add the feature classes to the map:
<SPAN class="keyword token">var</SPAN> map <SPAN class="operator token">=</SPAN> Project<SPAN class="punctuation token">.</SPAN>Current<SPAN class="punctuation token">.</SPAN>GetItems<SPAN class="operator token"><</SPAN>MapProjectItem<SPAN class="operator token">></SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">FirstOrDefault</SPAN><SPAN class="punctuation token">(</SPAN>e <SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN> e<SPAN class="punctuation token">.</SPAN>Name <SPAN class="operator token">==</SPAN> name<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> lyrDocFromLyrxFile <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">LayerDocument</SPAN><SPAN class="punctuation token">(</SPAN>layerFile<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> cimLyrDoc <SPAN class="operator token">=</SPAN> lyrDocFromLyrxFile<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetCIMLayerDocument</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> lcp <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">LayerCreationParams</SPAN><SPAN class="punctuation token">(</SPAN>cimLyrDoc<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
LayerFactory<SPAN class="punctuation token">.</SPAN>Instance<SPAN class="punctuation token">.</SPAN>CreateLayer<SPAN class="operator token"><</SPAN>FeatureLayer<SPAN class="operator token">></SPAN><SPAN class="punctuation token">(</SPAN>lcp<SPAN class="punctuation token">,</SPAN> map<SPAN class="punctuation token">,</SPAN> LayerPosition<SPAN class="punctuation token">.</SPAN>AutoArrange<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
I tried to add the table with:
<SPAN class="keyword token">using</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">var</SPAN> table <SPAN class="operator token">=</SPAN> geodatabase<SPAN class="punctuation token">.</SPAN>OpenDataset<SPAN class="operator token"><</SPAN>Table<SPAN class="operator token">></SPAN><SPAN class="punctuation token">(</SPAN>relationshipName<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
StandaloneTableFactory<SPAN class="punctuation token">.</SPAN>Instance<SPAN class="punctuation token">.</SPAN><SPAN class="token function">CreateStandaloneTable</SPAN><SPAN class="punctuation token">(</SPAN>table<SPAN class="punctuation token">,</SPAN> map<SPAN class="punctuation token">,</SPAN> table<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetName</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>The datatype is then: esriDatasetType.esriDTTable.
This resulted in these warnings:

When I right click on the warning I get the option to add the table to the map. Then the table is added in the correct way with the datatype: esriDatasetType.esriDTRelationshipClass.
Is it possible to do this with the ArcGIS Pro .NET sdk?
Thanks,
Tim