linq-to-nhibernate

Is there any consideration while comparing Enums in LINQ-to-NHibernate or LINQ?

In such a query: var q = from l in session.Linq<Letter>() where letterTypeSearch == null ? true : (l.LetterType.ToString() == letterTypeSearch) l.LetterType is an Enum. UPDATE It seems that's impossible to compare Enums in current linq-to-nhibernate. While letterTypeSearch is a string containing a LetterType instance...

Is there any work-around for NHibernate-to-LINQ not supporting subqueries?

I know LINQ-to-NHibernate currently does not support sub-queries (http://ayende.com/Blog/archive/2009/07/26/nhibernate-linq-1.0-released.aspx). Is there any workaround about it? ...

Linq 2 Sybase ASE database? What are the options?

I have a need to query an existing Sybase ASE database and would like to use Linq syntax for my data retrival. I don't need write access, nor do I need the full set of Linq operators, just Select(), SelectMany(), Where(), and GroupJoin() What are options are available? In particular, I'm wondering about nHibernate and building a ne...

Fluent NH and Interface mapping

Im really confused as I have several objects that share a common interface mapped using FNH like so: .Where(t => (t.BaseType == typeof(Entity) || t.BaseType == typeof(PipelineStep)) && t.Namespace.StartsWith("BigNose.Core.Domain") && !t.IsInterface) .IgnoreBase<Entity>() ...

NHibernate Linq - Duplicate Records

I am having a problem with duplicate blog post coming back when i run the linq statement below. The issue that a blog post can have the same tag more then once and that's causing the problem. I know when you use criteria you can do the followingcriteria.SetResultTransformer(new DistinctRootEntityResultTransformer()); How can I do t...

Looking for an open source project that uses Linq to NHibernate

I want to see Linq to NHibernate in action. Can anyone point me to an open source project (hosted somewhere like Codeplex or Github) where I can see Linq to NHibernate used in more than an exapmle. I've seen plenty of articles and code snippets, but I'd really like some usable applications. Thanks. ...

linq2nhibernate group by and orderby count() getting null reference

Hello, I'm trying to execute this linq2nhibernate query: from e in endContratoRepository.GetAll() where e.Contrato.idContrato == contrato.idContrato && e.Volume.idVolume == contratoVolume.Volume.idVolume && ...

How to perform join using LINQ for NHibernate

Can i join two tables using LINQ for NHibernate like I can do in LINQ To SQL? ...

NHibernate Linq Provider question

Can anyone answer me what are the differences of Session.Query Session.Linq and Session.QueryOver What I'm really interested in: What would be supported in the future versions. What should I start to use in a clean project. Please tell me your thoughts about these three... Thanks, Zoltán ...

How can I run NHibenate queries asynchronously?

Hello, One way to increase scalability of the server application is to run IO-bound operation (reading files, sockets, web requests, database requests etc) asynchronously. This does not mean run then in the ThreadPool which will just block threads while operation is being executed. The correct way is to use asynchronous API (BeginRead, ...

Group by and order by

using LINQ to NHibernate does anybody know how to use group by and order by in the same expression. I am having to execute the group by into a list and then order this, seem that I am missing soemthing here ??? Example:- Private function LoadStats(...) ... Dim StatRepos As DataAccess.StatsExtraction_vwRepository = New DataAccess.Sta...

Setting Linq to NHibernate ADO Command Timeout

How do I increase the timeout in NHibernate Linq To Sql? Not the Connection Timeout but the ado command timeout. using (ISession session = NHibernateHelper.OpenSession(NHibernateHelper.Databases.CarrierCDR)) using (session.BeginTransaction(IsolationLevel.ReadUncommitted)) { lCdrs = (from verizon in session.Linq<Domain.Verizon>(...

Difference between deferred execution and Lazy evaluation in C#

Hi , Could you please let me know what is the exact deference between deferred execution and Lazy evaluation in C#?These two are used synonymously.Could some one please explain the difference with an example?? ...

Nhibernate Linq In Clause

Is it possible to get Nhibernate linq to generate a query with an "In" clause? e.g. - Where AnID in (x,y,z)? ...

Is there Linq to Nhibernate for stateless session?

I was using regular session for loading some items from database via linq. The problem is that it caches the entities and memory load increases very much unnecessarily. Is there a way to replace session with stateless session without introducing many changes in client code? ...

Castle ActiveRecord: SessionScope.Current is null under IIS 7

I'm using ASP.Net MVC (still 1.0 for now) with Castle ActiveRecord and NHibernate.Linq. All is fine under IIS 6. However, I'm faced with a problem deploying my app to IIS 7: ActiveRecord's SessionScope.Current seems to be not available for some reason. Any ideas? ...

LINQ self referencing query

I have the following SQL query: select p1.[id], p1.[useraccountid], p1.[subject], p1.[message], p1.[views], p1.[parentid], max( case when p2.[created] is null then p1.[created] else p2.[created] end ) as LastUpdate from forumposts p1 left join ( ...

Does NHibernate LINQ support ToLower() in Where() clauses?

I have an entity and its mapping: public class Test { public virtual int Id { get; set; } public virtual string Name { get; set; } public virtual string Description { get; set; } } public class TestMap : EntityMap<Test> { public TestMap() { Id(x => x.Id); Map(x => x.Name); Map(x => x.Descript...

Linq to NHibernate wrapper issue using where statement

I'am using wrapper to get some data from table User IQueryable<StarGuestWrapper> WhereQuery = session.Linq<User>().Where(u => u.HomeClub.Id == clubId && u.IsActive).Select( u => new StarGuestWrapper() { FullName = u.Name + " " + u.LastName, ...

How to perform a execution time query using Linq to NHibernate

Hello, I am inserting a record into my table, but I want to be able to set my SortOrder field on insert to SELECT MAX(SortOrder) + 1 FROM Category WHERE SiteID = @SiteID. What is the easiest way of doing this? Here is my data structure: Category ID SiteID SortOrder Name I am using Fluent NHibernate and Linq to NHibernate. Thanks...