Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
return cn.Query<Fatura, Cobranca, Fatura>(sql, (f, c) =>
{
if (!faturas.TryGetValue(f.FaturaId.Value, out var fatura))
{
fatura = f;
fatura.Cobrancas = new Collection<Cobranca>();
faturas.Add(fatura.FaturaId.Value, fatura);
}
fatura.Cobrancas.Add(c);
return fatura;
}, new { dataCobranca = DateTime.Now.Date }, splitOn: "CobrancaId").Distinct().ToList();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.