Hi List,
i have a TimeEntry Table and get tho whole table by:
 List<TimeEntry> source =
SessionSource.Current.GetSession().Linq<TimeEntry>()

now i would like to use a constraint that only returns TimeEntry's
that have a ProjectState of ProjectState.Done in the associated
ProjectsTable.
Something like this:
  List<TimeEntry> source =
SessionSource.Current.GetSession().Linq<TimeEntry>().
                Select(Session.Linq<Project>().Where(p =>
p.ProjectState == ProjectState.Auftrag));

TimeEntry has a ForeignKey to Project.

The mapping looks like:
   Id(x =>
x.Id).GeneratedBy.GuidComb().UnsavedValue("00000000-0000-0000-0000-000000000000");
            Map(x => x.WorkDate).Not.Nullable().Length(8);
            Map(x => x.WorkTime).Not.Nullable();
            Map(x => x.Job);
            Map(x => x.ProjectGuid);  --------- FK to Project
            Map(x => x.EmployeeGuid);
            // References(x =>
x.Project).Not.LazyLoad().Cascade.SaveUpdate();
            SelectBeforeUpdate();
            DynamicUpdate();

Thanks
Peter

-- 
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