0

Is this a good idea? I just starting with FluentNHibernate, and it seems like a good idea for an MVC 3 application. That being said, it appears that you can essentially accomplish the same thing using the FluentNHibernate ClassMap derivatives. If that is the case, would it make sense to create an IDatabase interface with Insert, Update, Fetch, etc. functions and just apply that to the Map classes?

Part of the reason for me asking this is that I wrote a database wrapper for MySQL which has common functionality applied to it (Insert, Update, Delete, etc.), and I'd hate to see that go to waste. I'm beginning to wonder if a Database wrapper is even needed at all.

1 Answer 1

1

You use Fluent NHibernate to express the NHibernate mapping in C# code instead of creating XML mapping files. So FH is just a better way how to map your entities to database tables (object/relational mapping).

I don't know what you by "wrapper", but it is not recommended by Ayende to create another abstraction layer to hide NHibernate session. It can be used directly, it is described here.

Sign up to request clarification or add additional context in comments.

1 Comment

It's like Karel says in the above. FNH is just a mapping tool for NHibernate. You would use an NHibernate ISession or IStatelessSession to do the CRUD on the classes you have mapped to the database.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.