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.