c# - Create query "sum" mutiples columns in Nhibernate -


need create query query on (nhibernate) c#, add more 1 column. example in pure sql:

select sum(col1 + col2 + col3 + col4) tabela 

first made way:

table table = null; session.queryover<table>(() => tabela)        .select(projections.sum<table>(t => t.col1))        .select(projections.sum<table>(t => t.col2))        .select(projections.sum<table>(t => t.col3))        .select(projections.sum<table>(t => t.col4)) 

but way each column , generates 4 columns, add , generate column only.

it's simplier:

table table = null; session.queryover<table>(() => tabela)        .select(projections.sum<table>(t => t.col1 + t.col2 + t.col3 + t.col4)) 

Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -