Last active
March 16, 2018 17:21
-
-
Save Renancp01/acdd806d3f4395aaed9f60b89bf8170e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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