I've attached a stored procedure (see my previous question w/proc code) to my Entity Framework model with function import, selecting "Scalars: DateTime" to get a collection of DateTimes as the return type. I am calling that in my repository:
return _DataContext.GetPubsDistinctMonthYears(pubType, pubId).AsEnumerable();
I need the repository method to return IEnumerable; however, the function is returning ObjectResult<Nullable<DateTime>
(with the correct DateTime values in it), and if I cast it as IEnumerable, the result is just null.
"Safe cast" doesn't work either:
return _DataContext.GetPubsDistinctMonthYears(pubType, pubId) as IEnumerable<DateTIme>;
QUESTION
So what do I need to do either/both in the stored procedure and the repository to get my IEnumerable??