Questions tagged [nhlambdaextensions]

A project that provides extension methods for the NHibernate ICriteria interface to allow use of typesafe lambda expressions.

A project that provides extension methods for the NHibernate ICriteria interface to allow use of typesafe lambda expressions.

More info: https://code.google.com/archive/p/nhlambdaextensions/

20 questions
7
votes
2 answers

How do I express “not in” using lambdas?

I'm trying to create a not in clause with the NHibernate Criteria API using NHLambdaExtensions. Reading the documentation I was able to implement the in clause by doing .Add(SqlExpression.In(z => zoneAlias.ZoneId, new int[] { 1008, 1010…
Mike
  • 4,257
  • 3
  • 33
  • 47
5
votes
1 answer

Dividing using nhibernate results in "Could not determine member from"

This is probably something simple but I seem to be lacking some knowledge of how nhibernate works. This is my code: ICriteria query = Session.CreateCriteria(); query = query.CreateCriteria(x =>…
user246554
2
votes
2 answers

NHibernate Lambda Extensions - CreateCriteria Issue

I want to convert a NHibernate CreateCriteria over to a NHLambdaExtensions criteria, but I'm getting errors that I don't know how to fix. The NHibernate criteria looks like this: var departments = DepartmentService .CreateCriteria() …
Josh Close
  • 22,935
  • 13
  • 92
  • 140
2
votes
2 answers

How to render Max(Substring) with Lambda Extensions

I'm using NHibernate with Lambda Extensions. I'd like to know how to nest a Max function with a Substring. The following statement retrieves Max("invoice_id") var ret = session .CreateCriteria() …
2
votes
1 answer

Using an interface for a subquery in NHibernate

I normally query interfaces using DetachedCriteria in NHibernate: DetachedCriteria crit = DetachedCriteria.For(); And this works fine. I now want to create a subquery for a child object thus: DetachedCriteria subcrit =…
Stu
  • 2,426
  • 2
  • 26
  • 42
2
votes
1 answer

NHLambdaExtensions: Create a Criterion object to add to ICriteria later

My application creates a dynamically generated query at runtime based on user input by creating Criterion objects e.g: ICriterion criterion = Restrictions.Eq("Name", "John"); ...... detachedCriteriaSomewhereElse.Add(criterion); How do I do this in…
reach4thelasers
  • 26,181
  • 22
  • 92
  • 123
1
vote
1 answer

help with expression for nHibernate linq provider extension

I'm working on a custom linq extension for nHibernate by extending the BaseHqlGeneratorForMethod. The technique is documented here: http://fabiomaulo.blogspot.com/2010/07/nhibernate-linq-provider-extension.html I've had success with implementing…
Matt Johnson-Pint
  • 230,703
  • 74
  • 448
  • 575
1
vote
1 answer

.NET - execute a lambda on another computer

I've recently implemented an IronRuby web service application for a client, to replace an existing C# .NET DLL. What the client forgot to mention was that in the mean time they implemented a new version of the DLL, with a new API based on lambda…
1
vote
2 answers

C# Expression - Getdefault Value or convert int? to int

I have a Class like below public class GrouppedStockGift { public DateTime? TimeCreated { get; set; } public int? StoreID { get; set; } public int? UserCreated { get; set; } public int? WorksID { get; set; } public int?…
user4132661
1
vote
1 answer

fluent nhibernate problem mapping char(1) type

The map. public SocialCodeMap() { Id(x => x.SocialCodeId); Map(x => x.Name); Map(x => x.Code); Map(x => x.DisplayOrder); } And the Class. public class SocialCode { public virtual Guid SocialCodeId {…
0
votes
0 answers

How do I join two entities in Entity Framework using lambda expression?

0 I am new to Entity Framework. I am using abstract repository pattern. See I have 2 tables (Entities). InspectionReport and Projects. ID field of Projects is foreign in InspectionReport. I have successfully loaded the data from InspectionReport,…
CodingManiac
  • 123
  • 1
  • 1
  • 9
0
votes
1 answer

NHibernate 3.1: MissingMethodException when calling LambdaExtensions

Since upgrading from NH 3.0 to 3.1 I've been having some trouble using the following code: criteria = session.CreateCriteria() .Add(SqlExpression.InG(user => user.ID, toBeFechted)); // toBefetched is an IList This will…
ds99jove
  • 618
  • 2
  • 7
  • 21
0
votes
1 answer

Getting the result of a CompletableFuture.supplyAsync

I have this piece of code: CompletableFuture .supplyAsync(() -> { return smsService.sendSMS(number); }).thenApply(result -> { LOG.info("SMS sended " + result); }); but I got a compilation error: The method…
Nuñito Calzada
  • 4,394
  • 47
  • 174
  • 301
0
votes
1 answer

'OR' in NHibernate Lambda Extensions

How can I union two criteria with an OR statement? For example I want to get Employee which has null in Birthday field OR value of this field is less than someDate. How should I rewrite this code: var query = DetachedCriteria.For() …
Serhiy
  • 4,357
  • 5
  • 37
  • 53
0
votes
1 answer

NHibernate Lambda Extensions can't use any alias query on DetachedCriteria

I'm trying to write a simple query that requires an alias as it's a Many-To-Many assocation however I can't get it to work with NH Lambda Extensions. It always gives me a compile error even though as far as I can tell it's exactly the same as the…
Chris Marisic
  • 32,487
  • 24
  • 164
  • 258
1
2