Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nhibernate Database First

Tags:

c#

nhibernate

at start i'll tell you that i'm totally green with Nhibernate but i was wondering how to use Nhibernate into already made DataBase. The DataBase at itself is rather large (the part of it i'm using on my CPU to test on is 1gb). I'm not a huge fan of mapping by xml. I thought that this tool might help me (https://www.devart.com/entitydeveloper/) but it's performance is not satisfying. So am i supposed to go with code and then just map it with XMLs or what are my other possible ways i could go with?

like image 700
Kacper Werema Avatar asked Oct 18 '22 04:10

Kacper Werema


1 Answers

There are two options that I know of:

  • Fluent NHibernate: Fluent, XML-less, compile safe, automated, convention-based mappings for NHibernate
  • NHibernate.Mapping.Attributes: With NHibernate.Mapping.Attributes, you can use .NET attributes to decorate your entities and these attributes will be used to generate the mapping information
like image 157
Anton Gogolev Avatar answered Oct 21 '22 05:10

Anton Gogolev