Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Custom Templates> Retrieving OutputSettingValues for Relation in lpt
 

Pages: 1
Custom Templates
Retrieving OutputSettingValues for Relation in lpt
Page:1/1 

  Print all messages in this thread  
Poster Message
ww
User



Location:

Joined on:
01-Oct-2004 22:58:25
Posted:
65 posts
# Posted on: 17-Jun-2011 19:54:30.  
I have an lpt template in which I'm trying to retrieve a setting value for a Relation. So I've got a NormalRelationshipEdge and I'm trying to get to OutputSettingValues.GetRealBoolSettingValue, but OutputSettingValues isn't a member for NormalRelationshipEdge. I can't figure out how to get to the settings from here.
  Top
daelmo
Support Team



Location:
Guatemala City
Joined on:
28-Nov-2005 23:35:24
Posted:
8065 posts
# Posted on: 17-Jun-2011 22:34:28.  
Are you sure you want to retrieve a setting for a relation? Relations don't have output setting values. Navigators do have OutputSettingValues, but no settings, just Custom Properties and Attributes. What is the real setting you are trying to retrieve? Could you show me a snapshot?

David Elizondo
LLBLGen'ing (articles and code snippets) | linkedin | twitter
 
Top
ww
User



Location:

Joined on:
01-Oct-2004 22:58:25
Posted:
65 posts
# Posted on: 17-Jun-2011 23:05:38.  
Sorry, yes--navigator. I defined some custom settings in the frameworksettings file. In the Designer, I edit the entity, go to Code Gen Info, and select one of my relation navigators. I can then edit the output settings on the "Setting Values" tab.

I just realized that I need to call the Get*NavigatorAsObject method to get the navigator, then get the OutputSettingValues. What's the easiest way to work out which side of the relation I am on, to know whether to look at Start or End?

I used GetAllRelationshipsForEntity to get the relationships. I guess I'm looking for the easiest equivalent to "Foreach RelatedEntity" in TDL.
  Top
daelmo
Support Team



Location:
Guatemala City
Joined on:
28-Nov-2005 23:35:24
Posted:
8065 posts
# Posted on: 18-Jun-2011 00:14:29.  
Here is an example of how I would iterate the relations, pick the start navigator and ask for the setting:
Code:
var relationships = _currentProject.GetAllRelationshipsForEntity(entity, true);
foreach (var rel in relationships)
{
    var navigator = rel.GetStartNavigatorAsObject();
    string mySetting = navigator.GetRealStringSettingValue("mySettingName", _currentProject);    
}


David Elizondo
LLBLGen'ing (articles and code snippets) | linkedin | twitter
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.