Quantcast
Channel: XHEO.com Blog
Viewing all articles
Browse latest Browse all 25

Get NHibernate Entities by Property

$
0
0

While many of my entity classes use surrogate primary keys, they also have natural keys (Product SKU for example). When I want one of those entities it's more natural to use the natural key, naturally. Normally that requires a CreateCriteria call, I'd rather just call Get<T> like I can with the surrogate keys. So I created an extension method that lets me do this:


Viewing all articles
Browse latest Browse all 25

Trending Articles