linq-to-nhibernate Questions

2

Solved

I've got this entity with a <dynamic-component> entry and a number of properties on it. It's being consumed on the entity class as an IDictionary. The mapping works fine and everything is...
Vullo asked 18/4, 2011 at 18:9

1

Solved

I have NHibernate (with NHibernate.Linq and Fluent NHibernate) set up with query caching. Everything works fine until I do a session.Save(new Widget()) (i.e. SQL INSERT). After that point, all quer...
Chaussure asked 13/1, 2013 at 0:33

3

Solved

I have two similar queries theoretically returning the same results: var requestNotWorking = SessionManagement.Db.Linq<Item>(false).Where(i => i.Group != null && i.Group.Id == m...
Lidia asked 3/1, 2013 at 15:51

1

Solved

NHibernate version 3.3.1.4000 Query: IQueryable<Activity> activities = _repository.GetList<Activity>(); IQueryable<ActivityStatistic> statistics = activities .GroupBy(activity...
Arabele asked 9/8, 2012 at 8:53

2

Solved

Scenario: I have a customer object with lazy loading enabled. I use that throughout the program to call a list of customer for a listbox. It has relationships to the Division_Customer_Rel, Division...

1

Solved

Is it possible to convert this code at below, written by using Query(linq) api to Criteria or QueryOver API in NHibernate? I'm using this to format data into DTO's also it works with just one round...

1

Solved

I have two classes: public class Person { public int Id{get;set;} public string Name{get;set;} public List<Order> Orders{get;set;} } public class Order { public int Id{get;set;} public ...
Croak asked 1/11, 2012 at 5:22

4

Solved

I'm using Fluent NHibernate in one of my projects (and ASP.NET MVC application), with LINQ to query to data (using the LINQ to NHibernate libraries). The objet names are changed to protect the inn...
Linguiform asked 5/1, 2010 at 15:34

4

Solved

I want to do paging with NHibernate when writing a Linq query. It's easy to do something like this: return session.Query<Payment>() .OrderByDescending(payment => payment.Created) .Skip(...
Fun asked 10/2, 2011 at 10:7

3

Solved

I've been trying to get distinct values using Linq to NHibernate and I'm failing miserably. I've tried: var query = from requesters in _session.Linq<Requesters>() orderby requesters.Reques...
Marilla asked 9/9, 2010 at 15:9

1

Solved

I am trying to write QueryOver statement for selecting N rows in the descending time order. session.QueryOver<T>().Take(10).OrderBy(x=>x.DateInserted); Unfortunately this is not at all ...
Brierwood asked 23/6, 2012 at 18:35

2

Solved

I have a query by linq to NHibernate. var q = SessionInstance.Query<Request>().Max(e => e.Code); If Request table has no rows, execution of this query raises GenericADOException with th...
Lancaster asked 12/6, 2012 at 13:45

3

Solved

I would like to fetch all records from particular day, no matter what time is associated with those records. So far I have method like this: public IQueryable<Record> QueryByDay(DateTime day...
Kirven asked 6/6, 2012 at 18:36

1

Solved

I have next entities: class Topic { public virtual int Id {get; private set;} public virtual ICollection<Vote> Votes {get; private set; } } class Vote { public virtual Topic Topic {get;...
Coley asked 1/5, 2012 at 14:52

1

Solved

I'm trying to implement search functionality in an ASP.NET MVC 2 application. I create an expression based on criteria entered by the user: public ViewResult FindCustomer( string forename, string ...
Magpie asked 19/3, 2012 at 17:9

3

Solved

I have an NHibernate Linq query which isn't working how I would expect. The problem seems to come from using a nullable int column from a left joined table in the where clause. This is causing the...
Madeleinemadelena asked 17/2, 2012 at 12:4

2

Solved

LINQ to NHibernate removes parenthesis in where clause: session.Query<MyEntity>().Where(x => (x.MyProp1 < end && x.MyProp1 > start) || (x.MyProp2 < end && x.MyPr...
Ticktack asked 15/2, 2012 at 16:30

2

Solved

I have a query using linq to NHibernate, for EnterAndExitArchive entity. This entity has a association by Archive entity. public EnterAndExitArchive GetLastEnterAndExitArchive(long archiveId) { v...
Fernald asked 19/1, 2012 at 14:10

3

Solved

I'm using NHibernate 3.1.0 and I'm trying to extend the LINQ provider by using BaseHqlGeneratorForMethod and extending the DefaultLinqToHqlGeneratorsRegistry as explained in Fabio's post. For exam...
Roselinerosella asked 7/6, 2011 at 15:46

3

Solved

I'm using NHibernate 3.0 with both the LINQ provider and QueryOver. Sometimes I want to eager load related data, and there comes the method "Fetch" to the rescue, both in LINQ and QueryOver. Now I ...
Cameral asked 26/1, 2011 at 3:44

2

Solved

Does ToFuture works with nhibernate linq? If so, how do you use it?
Farra asked 30/3, 2011 at 15:26

1

Solved

I've an associated entity with <many-to-one> and that entity has two <many-to-one> that I want to fetch at once. I can achieve this by this query: var tshead = session.Query<MainEn...
Depositor asked 21/10, 2011 at 10:0

2

I am trying to get the following SQL output using Linq-to-NHibernate: SELECT DISTINCT Name, at.Year FROM MyTable mt INNER JOIN AnotherTable at ON at.Id = mt.AnotherTableId The Name and Year prop...
Kimbrough asked 16/11, 2009 at 4:21

2

Our application has the concept of Stories and the concept of Tags. A story can have many tags applied to it, and a tag can be applied to many stories, making the relationship many-to-many. The two...
Mollymollycoddle asked 24/5, 2011 at 14:57

1

I'm using LINQ to NHibernate's IQueryable implementation on a asp.net mvc Grid (telerik specifically), where I know I'll need to fetch something eagerly for this particular grid. So I have query t...
Teratism asked 9/3, 2011 at 19:47

© 2022 - 2024 — McMap. All rights reserved.