Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fluffynuts/ormnomnom
Simple comparison between Entity and NHibernate with a FluentMigrator spin-up, using SQLCE and Sqlite for testing purposes
https://github.com/fluffynuts/ormnomnom
Last synced: 5 days ago
JSON representation
Simple comparison between Entity and NHibernate with a FluentMigrator spin-up, using SQLCE and Sqlite for testing purposes
- Host: GitHub
- URL: https://github.com/fluffynuts/ormnomnom
- Owner: fluffynuts
- Created: 2014-11-17T07:23:13.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-11-17T07:51:56.000Z (about 10 years ago)
- Last Synced: 2024-11-17T05:56:21.309Z (about 2 months ago)
- Language: C#
- Size: 168 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
OrmNomNom
=========Simple comparison between Entity and NHibernate with a FluentMigrator spin-up, using SQLCE and Sqlite for testing purposes
OrmNomNom notes:1) When installing NHibernate, you probably want FluentNHibernate. Whilst
FluentNHibernate depends on NHibernate, it depends on version 3.3.something
or better, so nuget goes off and gets an old NHibernate. So install
NHibernate FIRST and then FluentNHibernate2) FluentNHibernate requires that you exlicitly exclude classes which are not entities
3) NHibernate entities must have VIRTUAL properties
4) NHibernate sessions and session builders MUST be disposed to release
connections on the databases at hand5) Side-note: SqlCe has a default policy on transaction disposal to ROLL BACK,
not COMMIT, so you MUST commit transactions if you ever get into SqlCe
land6) If you are using SqlCe with Entity, make sure that the following entry has
been added to your (app|web).config:
the Nuget package *should* do it for you, but I've had it *not* do it for
me on occasion7) if you do everything fluently with NHibernate, you shouldn't have to diddle
with the config8) don't forget to reference system.data.sqlserverce & set to copy local
7) Entity packages: you need EF (duh) and the provider for your test db
backend (SqlCe or Sqlite); ensure that you have the relevant EF provider
confing in your (web|app).config (this config discovered through trial,
error, weeping, gnashing of teeth, StackOverflow, more trial, more error
and finally, a wild guess which worked:
provider packages:
System.Data.Sqlite
EntityFramework.SqlServerCompact8) Note that I provide a DbConnection for contexts within my tests because
otherwise entity gets confused about which provider to use, since I have
several defined in the config file. You may not have to follow this approach
if you only use one provider type9) If you're using Sqlite for backing (file or in-memory) against Entity, you will have to
store integer values as LONGs since otherwise retrieval results in a failure as the
stored values are pulled up as int64 and then can't be applied to your int32 properties.