views:

889

answers:

2

It's possible to map a VIEW using Fluent NHibernate? If so, how?

+9  A: 

I would think you could just replace your the table name with your view name using the WithTable method:

WithTable("myview");
mxmissile
+2  A: 

mxmissile's answer is correct but I wanted to add that the view will have to be updateable (SQL Server term.) if you want to do inserts or updates against it. I have several tables mapped against views that filter out inactive records because these tables allow soft deletes.

Jamie Ide
If I recall, these "updateable" views are title Indexed Views? It's been awhile since I had to deal with this stuff.
mxmissile