Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Clientes (int codCli, string razao, string cpcn, VoEnderecos enderecos) {
- this.CodCli = codCli;
- this.Razao = razao;
- this.cpcn = cpcn;
- this.Enderecos = enderecos;
- }
- public int CodCli { get; set; }
- public string Razao { get; set; }
- public string cpcn { get; set; }
- public VoEnderecos Enderecos { get; set; }
- public class VoEnderecos {
- public string Endereco { get; set; }
- public string EnderecoNFE { get; set; }
- public VoEnderecos (string endereco, string enderecoNFE) {
- this.Endereco = endereco;
- this.EnderecoNFE = enderecoNFE;
- }
- };
- public IEnumerable<Clientes> RetornarClientePorID (int Id) {
- IConexaoFirebird conexao = _services.GetService<IConexaoFirebird> ();
- var qry = @"select codcli, razao, cpcn, 'teste1' as EnderecoNFE, 'teste2' as Endereco from clientes where codcli = @Codcli";
- var _conexao = conexao.ConectaBancoFireBird ();
- return _conexao.Query<Clientes, VoEnderecos, Clientes> (qry, (cli, end) =>
- {
- cli.Enderecos = end;
- return cli;
- }, new { Codcli = Id }, splitOn: "EnderecoNFE");
- }
Add Comment
Please, Sign In to add comment