Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>So, my solution was to just add another partial class and add a property with the get/set pointed to the oddly named FKBTableNameGoesHere property. That way we don't have to keep modifying the generated classes. Not exactly solving the problem, but should make it clearer to developers what the property means. Anyone see any potential issues with that solution?</p> <p><strong>Edit</strong> - So, apparently this only works for selecting data and not filtering based on it. Not as easy of a fix as I had hoped. Anyone have any other suggestions?</p> <p><strong>Edit 2</strong> - Jeeze, thought this would be somewhat of a common problem but I guess not. Anyway, turns out I was on the right track with this. I found this post:</p> <p><a href="https://stackoverflow.com/questions/1451295">Multiple foreign keys to the same table</a></p> <p>Which gave me the idea that I couldn't just link directly to the getter/setter for another property since there's probably a lot more than that going on behind the scenes. This guys solution wasn't exactly the answer, but it sent me in the rigth direction. Adding the association attributes is what finally did it:</p> <pre><code>public partial class ProblemClass { [Association(Name = "FK__SomeLinkHere", Storage = "_OriginalPoorlyNamedStorageVariable", ThisKey = "FK_1_Id", OtherKey = "Id", IsForeignKey = true)] public FKType MyNewBetterName { get { return this._OriginalPoorlyNamedStorageVariable.Entity; } set { this.OriginalPoorlyNamedStorageVariable = value; } } } </code></pre> <p>Going to leave the bounty open for anyone who can still come up with a cleaner solution.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload