views:

254

answers:

1

Hi there

I have a class.

public class MedicalRequest
{
    private int id
    private IList<MedicalDays> Days 
    private string MedicalUser
    ...
}

and another

public class MedicalDays
{
    private int id;
    private DateTime? day
    private MedicalRequest request
    ...
}

I'm using nhibernate to return a list of all the MedicalDays within a time span. I'd like to do something like this to the resulting list

//nhibernate query
IList<MedicalDays> days = daysDao.FindAll(searchCritCollection);

//select a list of days from resulting list
IEnumerable<MedicalDays> queriedList = days.SelectMany(i => i.MedicalRequest.MedicalUser == employee);

Linq tells me that the type cannot be inferred by the usage. I'd like to know what I'm doing wrong, and if there is a preferred way of doing something like this.

Thanks for your time.

+7  A: 

It seems to me, that you want to filter the list days. If that's what you want, you should use

days.Where(i => i.MedicalRequest.MedicalUser == employee);
Jason
I tried that, and I don't get any error, I also don't get any results. I can see the value of employee and i.medicalrequest.medicaluser being equal, but I get no results in queriedList
jim
Never mind that last comment. I had some white space at the end of one of my strings. Thanks for your time and quick answer.
jim