A provider for NHibernate library for .NET Framework which allows to use LINQ queries. Available since version 3.0.
Questions tagged [linq-to-nhibernate]
629 questions
0
votes
1 answer
How to compare just the date, not the timestamp using LINQ
I'm trying to compare just the date of a column but because the query below is also comparing the time I get no result set back.
How could I write this same LINQ query if I'm only interested in the actual date value matching?
The column "ImportDate"…

Toran Billups
- 27,111
- 40
- 155
- 268
0
votes
3 answers
Complex queries in linq to nhibernate
We are using accountability pattern for organizational structure. I using linq to nhibernate to find some departments and position but I have two problem.
var query =
Repository.Find(p => p.IsInternal == true)
.Where(p =>…
user39880
0
votes
3 answers
How to improve select performance in NHibernate
I need to materialize about 20000 records from database and write it as CSV. Unfortunately materialization of that records is extremely slow in NHibernate. Is there an option to get SQL generated by Nhibernate Linq Provider or write custom…

Sławomir Rosiek
- 4,038
- 3
- 25
- 43
0
votes
1 answer
Problems with ActiveRecord and LINQ queries
I have a simple class:
public class User : ActiveRecordLinqBase
{
[PrimaryKey(Column = "user_id", Length = 20)]
public string Id { get; set; }
[Property(Column = "password", Length = 16)]
public string Password { get; set; }
…

Oscar Mederos
- 29,016
- 22
- 84
- 124
0
votes
1 answer
NHibernate joins
public class Parent
{
public virtual long Id { get; set; }
public virtual string Name { get; set; }
public virtual List Children { get; set; }
}
public class Child
{
public virtual long Id { get; set; }
public virtual…

Dan Nick
- 132
- 1
- 2
- 12
0
votes
0 answers
Error with Ria Services only when Take query is used
I have a strange scenerio. RIA services is working for all of my entities except for one.
With this one entity, if the URL passed to the svc is standard, it works. If it has a take parameter, it does not work.
Example…

Bytemaster
- 166
- 7
0
votes
1 answer
Linq to NHibernateMax
I'm working on C# with Linq to NHibernate.
I defined 2 sets of classes and mappings:
public class Employee
{
public int ID { get; set; }
public string Name { get; set; }
}

katsu
- 1
0
votes
1 answer
NHibernate filter on property from many-to-one
I'm trying to use an NHibernate filter to filter on a parent class's property, but I keep getting an error that the multi-part identifier "Parent.Active" could not be bound. My filter-def is:
My parent class has…

Becca Dee
- 1,530
- 1
- 24
- 51
0
votes
1 answer
Order By nHibernate Causes 'Antlr.Runtime.NoViableAltException'
I get the following error
Exception of type 'Antlr.Runtime.NoViableAltException' was thrown.
[.OrderBy[ORM.Entities.Core.Message,System.DateTime](.Where[ORM.Entities.Core.Message](NHibernate.Linq.NhQueryable`1[ORM.Entities.Core.Message],
…

Steve
- 2,971
- 7
- 38
- 63
0
votes
1 answer
Query executes as 1 equals 1 instead of null check
I am trying to select all the rows where the 'Value' column is null or whitespace. It is of type nvarchar and is allowed nulls.
When executed the following query does not produce the correct sql.
current.Where(
a =>
…

JConstantine
- 3,980
- 1
- 33
- 46
0
votes
3 answers
Linq-to-nHibernate Query with multiple entities?
Does Linq-to-NHibernate support retrieving data from multiple entities in a single query?
e.g.:
Dim query = From f In context.Session.Linq(Of Floor)() _
Select f.Id, f.Name, f.Building.Id, f.Building.Name
Dim results =…

Starfield
- 119
- 3
- 9
0
votes
1 answer
Linq to nHibernate - exclude elements without child elements
var locations = (from location in session.Query()
where
(location.MB_ID == 0 || location.MB_ID == null) &&
(location.hide != "Y" || location.hide == null)…

Positonic
- 9,151
- 14
- 57
- 84
0
votes
1 answer
Incorrect SQL syntax from string Contains and StartsWith
session.Query().Where(p => p.Name.Conains("Paper"))
creates to the following SQL:
(...)
where prod1_.Name like ('%' || 'Paper' || '%')
What I would like to see is obviously: like '%Paper%'
I also have the same issue with StartsWith and…

Arnstein
- 1
- 1
0
votes
1 answer
howto query table per hierarchy which subclasses are present
a simple example
abstract class Car
{
public virtual long SerialNumber { get; set; }
}
class Mercedes : Car { }
class Fiat : Car { }
class Toyota : Car { }
now i want to query for which types inheriting from car are on stock. How to do this?…

Firo
- 30,626
- 4
- 55
- 94
0
votes
1 answer
could not resolve property: Date of: using DateTimeOffset (NHibernate 3.2.0.4000)
I recently got an exception from NHibernate when trying to access the Date property of a DateTimeOffset property.
var v1 = nhSession.Query.Where(o => o.DateTimeOffsetProperty.Date == DateTimeOffset.Now.Date).ToList();
I would have thought…

Becca Dee
- 1,530
- 1
- 24
- 51