Skip to content

Instantly share code, notes, and snippets.

@diedona
Last active November 16, 2019 16:07
Show Gist options
  • Save diedona/83e11b92c00ca3c34dfa1d94a8c02327 to your computer and use it in GitHub Desktop.
Save diedona/83e11b92c00ca3c34dfa1d94a8c02327 to your computer and use it in GitHub Desktop.
public class PersonService
{
private IComunicacao _comunicacao;
private IList<Pessoa> _dados;
public PersonService(IComunicacao comunicacao)
{
_comunicacao = comunicacao;
_dados = GerarDados();
}
public void DefinirEstrategia(IComunicacao comunicacao)
{
_comunicacao = comunicacao;
}
public IList<Pessoa> CarregarPessoas()
{
return _dados;
}
public bool EnviarComunicacao(Pessoa pessoa, Mensagem mensagem)
{
return _comunicacao.EnviarComunicacao(pessoa, mensagem);
}
#region [ DADOS PARA DEMO ]
private IList<Pessoa> GerarDados()
{
return new List<Pessoa>()
{
new Pessoa("Diego Doná", new DateTime(1989,6,19), "[email protected]", "+55897775654", "East Ride", Comunicacao.EMAIL),
new Pessoa("Luis Inácio", new DateTime(1967,2,21), "[email protected]", "+92984984", "West Ride", Comunicacao.SMS),
new Pessoa("Aécio Neves", new DateTime(1983,1,15), "[email protected]", "+65465456", "East Ride", Comunicacao.EMAIL),
new Pessoa("Alberta Vidima", new DateTime(1977,8,5), "[email protected]", "+874456363", "West Ride", Comunicacao.EMAIL),
new Pessoa("Luiza Albertina", new DateTime(1991,10,30), "[email protected]", "+2316586", "KimmingKnow", Comunicacao.EMAIL),
new Pessoa("Lucas Colombini", new DateTime(1984,11,28), "[email protected]", "+357565432", "ZigZigZow", Comunicacao.SinalDeFumaca),
new Pessoa("Danilo Rupert", new DateTime(1998,10,14), "[email protected]", "+15387485", "ZigZigZow", Comunicacao.SinalDeFumaca),
};
}
#endregion
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment