Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>My suggestion is to check out the tutorials of a few ORMs, and then go with whichever works best for you.</p> <p>The NHibernate <a href="http://nhforge.org/doc/nh/en/index.html#quickstart-intro" rel="nofollow noreferrer">reference documentation</a> suggests 30mins to get the example in the introduction chapter up and running.</p> <p>My own ORM short list would be:</p> <ul> <li>NHibernate</li> <li>Linq 2 SQL</li> </ul> <p>Some related questions:</p> <ul> <li><a href="https://stackoverflow.com/questions/3505/what-are-you-favorite-net-orms">What are your favorite .NET Object Relational Mappers (ORM)?</a></li> <li><a href="https://stackoverflow.com/questions/812081/which-net-object-relational-mapper-is-fastest">Which .NET Object Relational Mapper is fastest?</a></li> <li><a href="https://stackoverflow.com/questions/146087/best-performing-orm-for-net">Best Performing ORM for .NET</a></li> <li><a href="https://stackoverflow.com/questions/467620/what-are-the-differences-and-pros-and-cons-of-these-orm-tools-technologies">What are the differences and pros and cons of these ORM tools/technologies?</a></li> </ul> <p><strong>NHibernate Example</strong> </p> <pre><code>// create and save an entity var u = new User{ Name="foo", SignupDate=DateTime.Now }; session.Save( u ); // fetch and update entity, saving a related entity var post = session.Get&lt;Post&gt;( 42 ); post.Tags["foo"].Count++; session.Save( post ); // save a related item for an entity post.Tags.Add( new Tag("Name")); session.Save( post ); </code></pre> <p>Some example mappings and classes:</p> <pre><code>public class User { public virtual int Id { get; set; } public virtual string Name { get; set; } public virtual DateTime SignupDate { get; set; } } public class Post { public virtual int Id { get; set; } public virtual User User { get; set; } public virtual string Title { get; set; } public virtual string Body { get; set; } public virtual IList&lt;Tag&gt; Tags { get; set; } } public class Tag { public virtual int Id { get; set; } public virtual string Name { get; set; } public virtual string Count { get; set; } } &lt;class name="User" table="user"&gt; &lt;id name="Id"&gt; &lt;generator class="native" /&gt; &lt;/id&gt; &lt;property name="Name" /&gt; &lt;property name="SignupDate" /&gt; &lt;/class&gt; &lt;class name="Post" table="post"&gt; &lt;id name="Id"&gt; &lt;generator class="native" /&gt; &lt;/id&gt; &lt;property name="Title" /&gt; &lt;property name="Body" type="StringCLob" /&gt; &lt;!-- ntext --&gt; &lt;many-to-one name="User" /&gt; &lt;bag name="Tags" table="post_tag" cascade="save-update"&gt; &lt;key column="postid" /&gt; &lt;many-to-many class="Tag" column="tagid" /&gt; &lt;/bag&gt; &lt;/class&gt; &lt;class name="Tag" table="tag"&gt; &lt;id name="Id"&gt; &lt;generator class="native" /&gt; &lt;/id&gt; &lt;property name="Name" /&gt; &lt;property name="Count" /&gt; &lt;/class&gt; </code></pre>
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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