Using Projections.Concat inside a Projections.Conditional

153 views
Skip to first unread message

xanatos

unread,
Nov 10, 2012, 8:39:12 AM11/10/12
to nhu...@googlegroups.com
I want to use a Projections.Concat inside of a Projections.Conditional. The problem is that Projections.Concat returns a string instead of a IProjection. ** I DO KNOW I COULD USE Projections.SqlFunction ** . I have tried using Projections.Property but it didn't work:

var name = s.QueryOver<Person>(() => person)
            .Where(p => p.Name == "p1")
            .Select(Projections.Conditional(
                Restrictions.Where(() => person.Name != ""),
                Projections.Property(() => Projections.Concat(person.Name)),
                Projections.Property(() => person.Name)
            ))
            .SingleOrDefault<string>();

I even tried Projections.Constant but it didn't work.

Thanks
Reply all
Reply to author
Forward
0 new messages