Using SQL Server Views with NHibernate
Posted
by colinramsay
on Stack Overflow
See other posts from Stack Overflow
or by colinramsay
Published on 2010-03-17T14:00:34Z
Indexed on
2010/03/17
14:01 UTC
Read the original article
Hit count: 183
nhibernate
I have a site that sells cars. On the frontend, I want to only show cars that are published, and on the backend I want to show all cars. Whether a car is published or not depends on a number of factors, so I wanted to create a view to simplify this.
My question is, can I reduce duplication by dynamically telling NHibernate to sometimes use the "PublishedCar" view and something use the "AllCar" view when querying/fetching Car entities?
© Stack Overflow or respective owner