Guest User

Untitled

a guest
Nov 17th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. public Clientes (int codCli, string razao, string cpcn, VoEnderecos enderecos) {
  2. this.CodCli = codCli;
  3. this.Razao = razao;
  4. this.cpcn = cpcn;
  5. this.Enderecos = enderecos;
  6.  
  7. }
  8. public int CodCli { get; set; }
  9. public string Razao { get; set; }
  10. public string cpcn { get; set; }
  11. public VoEnderecos Enderecos { get; set; }
  12.  
  13. public class VoEnderecos {
  14.  
  15. public string Endereco { get; set; }
  16. public string EnderecoNFE { get; set; }
  17.  
  18.  
  19. public VoEnderecos (string endereco, string enderecoNFE) {
  20. this.Endereco = endereco;
  21. this.EnderecoNFE = enderecoNFE;
  22.  
  23. }
  24.  
  25. };
  26.  
  27. public IEnumerable<Clientes> RetornarClientePorID (int Id) {
  28. IConexaoFirebird conexao = _services.GetService<IConexaoFirebird> ();
  29. var qry = @"select codcli, razao, cpcn, 'teste1' as EnderecoNFE, 'teste2' as Endereco from clientes where codcli = @Codcli";
  30. var _conexao = conexao.ConectaBancoFireBird ();
  31. return _conexao.Query<Clientes, VoEnderecos, Clientes> (qry, (cli, end) =>
  32. {
  33. cli.Enderecos = end;
  34. return cli;
  35. }, new { Codcli = Id }, splitOn: "EnderecoNFE");
  36. }
Add Comment
Please, Sign In to add comment