Subsonic 3 LINQ Projection problem, fixed or not?

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

+5
3

SubSonic.Core : Subsonic 3.0 linq

.

, , .

+2

(, _pulseQuery _accountQuery), . SimpleRepository ActiveRecord Query ?

+2

, , - ...

"" GitHub : https://github.com/rally25rs/SubSonic-3.0/commit/61af6aeb2ebb95f486d8df533bf13c8754d443e2

There is also a slightly deeper issue here. If you decide to use the “standard .NET inline” projections, then some of the SubSonic unit tests will fail because the SS does some extra things in its generation of predictions that the .NET projection does not, so some of the expected functionality of SS does not work.

Personally, I believe that slow performance (although I did not notice a decrease in speed) is a small price for the right data.

+1
source

All Articles