Questions tagged [fluent-nhibernate]
Fluent NHibernate lets you write NHibernate mappings in strongly typed C# code. This allows for easy refactoring, improved readability and more concise code.
fluent-nhibernate
5,491
questions
0
votes
1
answer
35
views
What is the Use of Inverse() in Nhibernate
In my project i see the below code where is Inverse() is used I want to understand what is use of it and parent child relationship works with and without inverse
public CityMap()
{
Table("...
0
votes
0
answers
25
views
Nhibernate get max items
I have a plan table which is having the following structure
id plan_id plan_number
1 1 1
2 1 2
3 1 3
4 2 1
5 2 2
for each plan I would like ...
0
votes
0
answers
17
views
Fluent NHibernate multiple tables with shared data models
I work with a database with several practically identical tables. For illustrative purposes they look like this:
CREATE TABLE MyTable (
Id INT NOT NULL,
Title VARCHAR(255) NOT NULL
)
INSERT ...
0
votes
1
answer
73
views
GlobalType mapping in Fluent Nhibernate and npgsql
I'm migrating my project to use newest Npgsql library (v 8.0.2). I used this construction to map C# type to the Postgres type:
var nameTranslator = new NpgsqlSnakeCaseNameTranslator();;
...
0
votes
0
answers
11
views
Exception when using Sqlite with Nhibernate for integration tests
I get Exception when using Sqlite with Nhibernate for integration tests:
TypeLoadException":generic arguments[0], "system.nullable {system.datetimeOffset} on System.Nullable[T] violates the ...
0
votes
1
answer
68
views
NHibernate: Entities Mapped Incorrectly Despite Correct Configuration
I'm facing an issue with NHibernate where entities are being mapped incorrectly despite what seems to be the correct configuration. Here's a summary of the scenario:
I have a class ProductPrices with ...
0
votes
0
answers
24
views
How to get all objects with parameters of other tables in NHibernate?
I have two classes:
public class Catalog
{
public virtual int Id { get; set; }
public virtual string Name { get; set; }
public virtual IList<Article>? Articles { get; set; }
...
1
vote
0
answers
89
views
Writing NetTopologysuite Point geometry to PostgreSQL with fluent nhibernate fails due to custom type mapping
I just copied some outdated code to a new project with latest libs and writing of NTS geometries to PostgreSQL no longer works. Anyone has a hint for me?
DB setup is done as follows:
var db = ...
0
votes
0
answers
25
views
How to reference both entities when having only one column in one table in Fluent Nhibernate?
So, I have two classes defined as such:
public class Booking {
public virtual ID {get;set;}
public virtual Room BookedRoom {get;set;}
//....
}
public class Room {
public virtual ...
0
votes
0
answers
31
views
Installing FluentNHibernate creates conflicts between different versions of "NHibernate"
This are the warnings I get:
Found conflicts between different versions of "NHibernate" that could not be resolved.
There was a conflict between "NHibernate, Version=5.3.0.0, Culture=...
0
votes
1
answer
26
views
How to join multible Tables using linq with fluent nHibernate (left join)?
This are my domain classes:
public class File
{
public virtual long LFD { get; set; }
public virtual long AK_KEY_PE_WERBER { get; set; }
public virtual long AK_KEY_PE_RECHT { get; set; }
...
-1
votes
1
answer
49
views
Select items from a group by where count is larger than 1
The following sample query:
select * from (
select m.name, count(m.id) c from mytable m
group by m.name) a
where a.c > 1
How do I build that using NHibernate QueryOver?
It is easy ...
0
votes
1
answer
55
views
NHibernate OrchardCMS and Long Id: object references an unsaved transient instance
I'm using OrchardCMS (1.10.x) as a Web Application. OrchardCMS use integer field as primary key on database (ContentItemRecord.Id). However, soon, the web application will need more than pass the max ...
0
votes
0
answers
40
views
HasMany mapping on child tables on loose foreign key with different data type
I have this issue on Nhibernate where I'm trying to map
Documents to Student
class Student
{
public virtual int StudentId { get; set; }
public virtual ICollection<Document> Documents { ...
0
votes
1
answer
88
views
Fluent nhibernate BuildSessionFactory with Microsoft.Data.Sqlite is not Working
Trying to establish session factory on Microsoft.Data.Sqlite with fluent nhibernate. All references are added and are available in the bin folder on runtime.
var sessionFactory = Fluently.Configure()
...