2
I need to return the sum of the column value_business, I have the following expression
dynamic contato = (from a in context.Negocio
join cli in context.Pessoa on a.id_cliente equals cli.id_pessoa
join col in context.Pessoa on a.id_colaborador equals col.id_pessoa
where cli.id_empresa == idEmpresa
&& a.data_inicio >= dataInicial
&& a.data_inicio <= dataFinal
&& a.status == "Contato"
&& (idCliente == 0 ? a.id_cliente != 0 : a.id_cliente == idCliente)
&& (idColaborador == 0 ? a.id_colaborador != 0 : a.id_colaborador == idColaborador)
select new
{
a.id_negocio,
a.id_colaborador,
a.id_cliente,
a.id_empresa,
cli = cli.razao,
col = col.razao,
a.titulo,
a.descricao,
a.valor_mensalidade,
a.valor_negocio,
a.cli_primens,
//a.data_inicio,
//a.data_fim,
a.status
}).ToList();
how to change to bring also the sum of the column value_business? example: if the database has 10 records, and each record the business value is 10, need to be returned 100
Whether to group values ????
– novic
Virgilio, I need to add the values, if the bank has 10 records, and each record the business value is 10, need to be returned 100
– alessandre martins
Need to group so this will return depending on the grouping 1 row for each ! that’s what you need?
– novic
I want only one line with the total (from the value field ) of all records
– alessandre martins