Changing a properties name in BO mapper


Author
Message
Scott
Scott
StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)
Group: Forum Members
Posts: 176, Visits: 1.5K
I am doing a conversion from our old Fox data to SQL, some of the field name in FoxPro are causing problems with the generated code for the BO mapper.  Field names like operator, or code cause the generated code to error and not compile.  Is there a way that I can 'change' the name of the field in the BO so that it will compile but still have it access the correct column in the underlaying table with out having to change all the Fox field names?

Scott

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Scott,

Just copy the generated code for a field (BO.designer.cs or BO.designer.vb Wink and go back into the BO Mapper.  Selec the field in question and then click "Custom Code."  Paste the copied field property into the text box at the bottom.  Change the name in brackets to a different name but leave the name that is returned alone.

Example:

Public Property [ChangeThisValue] As String

This way when you rebuild your partials it will not overwrite your changes.  This way you can just change the name of the field while still referencing the old field name internally.

Scott
Scott
StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)
Group: Forum Members
Posts: 176, Visits: 1.5K
That worked great,  Thanks Trent
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Glad to hear it Smile
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search