0
我有一個Silverlight應用程序和一個domaindatasource控件的gridview綁定,我使用兩個參數從域數據源查詢視圖,但是從結果中我需要總計4列,由其他人分組。DataDomainService上的SUM和GROUPBY lambda表達式
我的元數據類:
internal sealed class vwAplicacoesMetadata
{
// Metadata classes are not meant to be instantiated.
private vwAplicacoesMetadata()
{
}
public Nullable<int> CodInternoCliente { get; set; }
public Nullable<int> CodTipoOper { get; set; }
public string CPFCNPJCliente { get { return this.CPFCNPJCliente; } set { String.Format("{0,-14}", value); } }
public string TipoClientePFPJ { get; set; }
public string NomeCliente { get; set; }
public DateTime DataOper { get; set; }
public decimal LCQtde { get; set; }
public decimal LCValor { get; set; }
public decimal LDQtde { get; set; }
public decimal LDValor { get; set; }
}
}
而且IQueryable的功能,我需要使用GROUPBY和總和表達式:
public IQueryable<vwAplicacoes> GetVwAplicacoesPorData(DateTime pstrDataInicio, DateTime pstrDataFinal)
{
return this.ObjectContext.vwAplicacoes.Where(d => d.DataOper > pstrDataInicio && d.DataOper < pstrDataFinal)
}
它的工作,現在我需要組通過CPFCNPJCliente,NomeCliente,TipoClientePFPJ,CodInternoCliente和CodTipoOper,並將字段LCValor,LCQtde,LDValor,LDQtde相加。
有什麼建議嗎?
謝謝shree.pat18 – raddesso