You can do this:

session.CreateQuery(@"
select en.prop1,en.prop2 from
MyEntity en").List<object[]>()

This returns an object array for each row. The object at index 0 is
en.prop1, at index 1 is en.prop2, and so on.

Then use .NET's LINQ to Objects to build an anonymous type:

.Select(projectedItems => new { prop1 = projectedItems[0], prop2 =
projectedItems[1]});




On Thu, Aug 19, 2010 at 5:24 AM, osman nuri katib
<[email protected]>wrote:

> Is the way to generate another partial class?
>
> 2010/8/19 osman nuri katib <[email protected]>
>
>  In Nhibernate,can we generate Anonymus type?
>>
>> For example In LINQ
>>
>> select new
>> {
>> xxxx=record.Name,
>> yyyy=record.Surname
>> }
>>
>> How can I do this in NHibernate?
>>
>
>
>
> --
> Osman Nuri KATİB
>        YTÜ
> Bilgisayar Mühendisliği
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to