Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Assuming I'm understanding your question what you might want is a helper class for each entity you have with things like column names, property names and other useful things, especially if you want to use ICriteria searches. <a href="http://nhforge.org/wikis/general/open-source-project-ecosystem.aspx" rel="nofollow noreferrer">http://nhforge.org/wikis/general/open-source-project-ecosystem.aspx</a> has plenty of projects that might help. NhGen (<a href="http://sourceforge.net/projects/nhgen/" rel="nofollow noreferrer">http://sourceforge.net/projects/nhgen/</a>) creates very simple helper classes which might help point you down a design path for what you might want.</p> <p><strong>Clarification Edit:</strong> following an "I don't understand" comment</p> <p>In short, I don't beleive there is a solution for you just yet. The QueryOver project hasn't made it as far as you want it to. So as a possible solution in the mean time, to remove magic strings build a helper class, so your query becomes</p> <pre><code>var x = session.QueryOver&lt;Shuttle&gt;().Add(SpatialRestrictions.Intersects(ShuttleHelper.Abc, other_object)); </code></pre> <p>That way your magic string is behind some other property ( I just chose .Abc to demonstrate but I'm sure you'll have a better idea of what you want ) then if "abc" changes ( say to "xyz" ) you either change the property name from .Abc to .Xyz and then you will have build errors to show you where you need to update your code ( much like you would with lambda expressions ) or just change the value of the .Abc property to "xyz" - which would really only work if your property had some meaningfull name ( such as .OtherObjectIntersectingColumn etc ) not that property name itself. That does have the advantage of not having to update code to correct the build errors. At that point your query could be</p> <pre><code>var x = session.QueryOver&lt;Shuttle&gt;().Add(SpatialRestrictions.Intersects(ShuttleHelper.OtherObjectIntersectingColumn, other_object)); </code></pre> <p>I mentioned the open source project ecosystem page as it can give you some pointers on what types of helper classes other people have made so your not re-inventing the wheel so to speak.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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