I am currently facing the issue mentioned here (and a few other places): Issue with Subsonic 3 Linq Projection
This happens using the 3.0.0.4 release package, and it also happens when I take the latest version of GitHub and create it.
I am using LINQ templates.
I have this code:
var newModel = new ViewModels.HomeIndexViewModel() {
PulseListViewModel =
new ViewModels.PulseListViewModel
{
Pulses = from p in _pulseQuery
join a in _accountQuery on p.AccountId equals a.AccountId
orderby p.CreateDate descending
select new PulseListViewModel.Pulse()
{
AccountName = a.Name
, Category = p.Category
, CreateDate = p.CreateDate
, Link = p.Link
, Message = p.Message
, Source = p.Source
, Title = p.Title
}
}
};
But the account name is always null.
If I changed the account name to the name:
var newModel = new ViewModels.HomeIndexViewModel() {
PulseListViewModel =
new ViewModels.PulseListViewModel
{
Pulses = from p in _pulseQuery
join a in _accountQuery on p.AccountId equals a.AccountId
orderby p.CreateDate descending
select new PulseListViewModel.Pulse()
{
Name = a.Name
, Category = p.Category
, CreateDate = p.CreateDate
, Link = p.Link
, Message = p.Message
, Source = p.Source
, Title = p.Title
}
}
};
It works great. But this is unacceptable in our project; I cannot always line up names (besides the fact that this will make things less clear if possible).
But I am very confused, because it seems that this problem is fixed:
"Fixed a bug where Projections returned zero or empty settings"
- http://blog.wekeroad.com/2010/03/21/subsonic-3-0-0-4-released
, - : , , , http://github.com/funky81/SubSonic-3.0/commit/aa7a9c1b564b2667db7fbd41e09ab72f5d58dcdb ? - . , SubSonic, , . , , .