Last active
June 9, 2019 23:37
-
-
Save jfbueno/a44602eb306a531554c5054f15122a00 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
public class EventosRepository | |
{ | |
public Evento[] ObterEventos() | |
{ | |
var eventos = Connection.Query<Evento>("Select * From Eventos Limit X, Y"); | |
ComporRelacionados(eventos); | |
return eventos; | |
} | |
private void ComporRelacionados(Evento[] eventos) | |
{ | |
foreach(var evento in eventos) | |
{ | |
evento.Convidados = | |
Connection.Query<Convidado>("Select * From Convidados Where EventoId = @id", new { id = evento.Id } ); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment