Our you can use ActiveRecord Linq (way better):
public static IList<Models.Employee> GetEmployees() {
return (
from x in Models.Employee.Queryable
select new Models.Employee() {
firstname = x.firstname,
lastname = x.lastname
}
).ToList();
}
Sincerely,
William Chang
http://www.williamchang.org
http://www.babybluebox.com
On Sep 7, 10:22 pm, olcay şeker <[email protected]> wrote:
> how can i write this query "select firstname,lastname from employees
> " with ICriteria api instead of hql? i tried with projection but
> failed.
>
> session.CreateCriteria(typeof(employees)).SetProjection
> (Projections.Property("firstname")).SetProjection(Projections.Property
> ("lastname")).List();
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" 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/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---