Persisting to flat files rather than a database

14 views
Skip to first unread message

x97mdr

unread,
Mar 25, 2009, 8:01:54 AM3/25/09
to nhusers
Has anyone ever used NHibernate (say with the text odbc drivers) to
persist their information to a set of flat files in addition to a
database?

The reason I ask is that my application can retrieve information from
either a set of flat files OR a database. I can use NHibernate for
the database part but if possible it would be cool to use it with the
flat file part too.

If it can't happen then no big deal, I can always write the stuff
myself but I thought I would ask in case anyone has had this problem.
Message has been deleted

JozefSevcik

unread,
Mar 26, 2009, 5:26:05 PM3/26/09
to nhusers
or maybe sqlite/whatever-embedded may be granted as 'flat file' too ;)

Ken Egozi

unread,
Mar 27, 2009, 3:59:11 AM3/27/09
to nhu...@googlegroups.com
If you're using (for instance) the repository pattern and also an IoC of some kind, you could have
IFooRepository with two implementations - NHFooRepository and FSFooRepository, and your IoC will supply each service with the correct implementation (either NH or FS based) based on a context
Reply all
Reply to author
Forward
0 new messages