Free NHibernate or NHibernate for Linq?

Free NHibernate or NHibernate, which one do we prefer for linq support?

+3
source share
4 answers

Fluent NHibernate is the configuration, and Linq is for queries. They do different things, and you can use them at the same time. Fluent NHibernate is not a replacement for NHibernate or Linq, but just a helper library that helps you configure NHibernate in your code, rather than using XML files.

+22
source

NHibernate, (LINQ) CRUD . NHibernate XML. Fluent NHibernate . , , FNHib . Linq, Hql, Criteria QueryOver, NHibernate.

+4

NHibernate - XML

Fluent NHibernate - # VB.NET

Fluent NHibernate, , XML. , . intellisense . , , , .

Linq Fluent NHibernate - NHibernate. , , Fluent NHibernate NHibernate, NHibernate. :

        var maleCustomers = (from t in Session.Query<Entities.Customer>()
                   where t.Gender == Gender.Male
                   select t).ToList();

Fluent NHibernate, .Query<> " ", , namespace NHibernate.Linq. , Linq.

, , Linq NHibernate Linq Sql . . , , , Sql.

: , Linq, , NHibernate Linq.

0

NHibernate CodeFirst, DBA ( ). POCO.

, Fluent Overrides , , Fluent Conventions. Fluent Automapping , .

, , LINQ . NHibernate LINQ LINQ , , . , LEFT OUTER JOINS NHibernate LINQ. LINQ , , HQL ICriteria LINQ.

show_sql NHibernate.SQL log4net , SQL .

In situations where I want to control my connections or my greedy choice, I sometimes choose HQL or ICriteria , which gives me more control over what NHibernate does with my queries.

In essence, Fluent gives you great flexibility in displaying your objects and a combination of approaches (LINQ, HQL and ICritieria) allows you to handle almost any situation with queries / settings.

0
source

Source: https://habr.com/ru/post/1757610/


All Articles