625 questions
0 votes
1 answer
76 views
Even if it works as HQL, NHibernate linq joining a subquery with grouping and using grouping subquery projections in join key and result causes errors
I need to write an nhibernate query as linq syntax to produce a IQueryable but I have some issues even if it works as HQL query. I need to use IQuerayable for another purpose since hql doesn't result ...
1 vote
0 answers
49 views
NHibernate Delete from IQueryable with .Take
When trying to delete records in chunks from an IQueryable like this session.Query<CityEntity>().Where(x => x.PostalCode.StartsWith("5")).Take(100).Delete() I get this exception: ...
1 vote
1 answer
88 views
NHibernate - Problem with creating a custom Linq extension
I have such query in NH Linq: var query = _session .Query<Revision>() .Join( _session.Query<Document>(), rev => rev.Document, doc => doc, (rev,...
0 votes
0 answers
70 views
How to modify treeBuilder.Dot to generate LEFT JOIN instead of INNER JOIN in custom function generator for NHibernate?
Im trying to extend LINQ to NHibernate provider for my custom function. The problem that I found is that, whenever I try to access a FK from my entity, it generates a "INNER JOIN" statement, ...
0 votes
1 answer
50 views
Can I use NHibernate.Cfg.Configuration in Fluent-NHibernate when building a session factory?
I want to use the NHibernate configuration for FluentNhibernate when building a session. This how I am constructing my factory session: lock (_factorylock) { if (_factory ==...
0 votes
1 answer
175 views
NHibernate: Fetch an association which exists only in a subclass of the Query<>'d type
I've got a table-per-subclass setup using NHibernate & I'm trying to construct a LINQ query which pre-fetches certain properties that can exist in the derived classes, but I just can't work out ...
0 votes
1 answer
142 views
force to use join in nhibernate syntax instead of iteration
i am trying to figure out why nhibernate query iterates on values instead of using joins internally. due to this iteration it becomes slower, cause it will iterates all values one by one. i.e. it ...
0 votes
1 answer
104 views
How to update Entity that have one-to-one relation?
I have entities as follows: public class Device { public long Guid { get; set; } public List<Computer> Computers { get; set; } public string ShopName { get; set; } } public class ...
1 vote
1 answer
449 views
The ExceptResultOperator result operator is not current supported
I want to exclude one resultset from another and I am using Except for that but it is giving error that "The ExceptResultOperator result operator is not current supported". I can not use all ...
2 votes
1 answer
265 views
could not resolve property: CS$<>8__locals2 of: BusinessObjectMain; Nhibernate QueryOver Linq, lambda expression inside a for loop
We use Vs2019 with an older version of Nhibernate 3.2. We recently upgraded to VS2019. This code worked correctly in VS2010. We are getting this error with Nibernate QueryOver, lambda expressions ...
0 votes
1 answer
209 views
How do I get NHibernate to generate SQL for a computed property?
I've Googled around and come up with sample code, but it's giving me trouble. Here's what I've got, based on what I found: In the persistent class I have public static readonly Expression<Func<...
0 votes
2 answers
461 views
Custom Query Extension, which works with NHibernate
I am trying to write a custom Linq extension, which can also be performed within the DB. Basically, what I want to do is collectionOfStrings.Where(x => !x.IsNullOrWhiteSpace) Unfortunately it's not ...
-1 votes
1 answer
332 views
How to join two tables queries and select matching the records in Nhibernet linq?
I am trying to develop one single query which gives me records from both the table in one result using linq-Nhibernet query. I have two tables first one :account (accountId , accountDescription) and ...
1 vote
2 answers
603 views
How do I use LINQ with GROUP BY and multiple MAX(...) to select multiple fields? [closed]
I need to select fields from unique records within a table with multiple where clauses. I currently am using C# and LINQ fluent syntax connected with NHibernate. So I am wondering if there is a way ...
-1 votes
1 answer
66 views
Is there a best way to delete very data in database like 160k of data with Nhibernate
I have like 120k of data in a table using mssql and i have to delete all to save again, but it´s turn very slow. I´ve an Entity called InventarioEstoque and have two childrens ...