Questions tagged [linq-to-nhibernate]

A provider for NHibernate library for .NET Framework which allows to use LINQ queries. Available since version 3.0.

629 questions
0
votes
2 answers

null reference exception in Count of linq to nhibernate query

I have a linq query by NHibernate. var q = SessionInstance.Query() .Count(x => MyPerson != null && x.Person.Id == MyPerson.Id); But Check condition in Count Is not Valid. Because if value of MyPerson be null ,expected result of…
Ehsan
  • 3,431
  • 8
  • 50
  • 70
0
votes
1 answer

NHibernate QueryOver to get records which are not older than N days

I have problem while retrieving the records which are not older than 30 days. As today's date is 24 Jun, I would like to select records not beyond than 23rd May. That is I need all records for the days in between 23rd May and Today. For that The…
navule
  • 3,212
  • 2
  • 36
  • 54
0
votes
1 answer

OutOfMemory Exception while fetching large sized data using QueryOver<> in Linq to Nhibernate

I have a asp.net web application that is using Linq to NHibernate in NHibernate 3.0. In a function, I need to get around 20000 records from a table which contains 10 million records with 20 columns. I am using Session.QueryOver<>() method for…
Rupendra
  • 608
  • 2
  • 11
  • 42
0
votes
1 answer

How can I convert that QueryOver<> code to use Query<> with NHibernate 3.3

I have a Class A that have a class B List ... So, with QueryOver I have : ClassB lb = null; var result = session.QueryOver .JoinAlias(x => x.ListB, () => lb, JoinType.LeftOuterJoin) .Where(() => lb.Property == 1) …
Paul
  • 12,359
  • 20
  • 64
  • 101
0
votes
2 answers

nHibernate - Fetch with private collection

Is there a way to use Fetch with collection that is private? This is what i have for code: public class Owner { private ICollection _cats = new List(); public virtual int Id { get; set; } public virtual IEnumerable Cats…
0
votes
4 answers

NotSupportedException when I'm using a method in the where clause

I'm using nHibernate 3.2.0.4000. I wrote this query using nHibernate.Linq var entities = (from t in this.Session.Query() where NotIn(t, role.Tasks) select t).ToList(); Here's the definition of the method…
JiBéDoublevé
  • 4,124
  • 4
  • 36
  • 57
0
votes
2 answers

Accessing joined object in linq join

I'm trying to do a fairly simple linq join like so: var locations = (from location in session.Query() join speed in session.Query() on location.ISDNSpeed equals speed.Id where …
Positonic
  • 9,151
  • 14
  • 57
  • 84
-1
votes
1 answer

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 == null) { …
-1
votes
1 answer

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 second one: accountdescriptionhistory (accountId,…
Coder007
  • 37
  • 6
-1
votes
1 answer

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 InventariosEstoquesSaldos and InventariosEstoquesSaldosTerceiros, i…
-1
votes
2 answers

nhibernate force separate queries instead of join

I'm new to nhibernate and I couldn't figure this one out. I have an entity similiar to below class; public class MotherCollection { public virtual int Id { get; set; } public virtual string Name { get; set; } public virtual ISet
Rudithus
  • 183
  • 13
-1
votes
2 answers

Converting SQL Server query containing GROUP BY into NHibernate LINQ

I'm basically trying to retrieve a paged list of unique GUIDs, sorted by (row) creation date. I've been able to draft a SQL Server query that seems to work for me based on this answer, but now I have to translate that into LINQ. SELECT TOP 15…
Alexandru Marculescu
  • 5,569
  • 6
  • 34
  • 50
-1
votes
1 answer

Nhibernate can not save new item to postgresql database

I have a problem with class which should: issue couple invoices, shows/update progress bar and save to nhibernate classes some values. Below code shows function which calls WyemitujFakture and display progress bar windows. private void…
JacekRobak85
  • 93
  • 1
  • 10
-1
votes
2 answers

Read-only access to SQL Server 2008

I need to give business analysts a web tool to query row data in a SQL Server production DB (I know it's not a good idea, but big boss said so ...). How do I make sure they can only run SQL SELECTs or LINQ Selects, but not modify anything? My plan…
Lincoln
  • 749
  • 1
  • 7
  • 13
1 2 3
41
42