blob: 431c4a80fef96fa7e20717bf18df51d626f6dbb0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
using FluentNHibernate.Mapping;
using Gestor.Infrastructure.Entities.Financeiro;
using Gestor.Infrastructure.Entities.Generic;
using System;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
namespace Gestor.Infrastructure.Mappings.Financeiro
{
public class FornecedorMap : ClassMap<FornecedorDb>
{
public FornecedorMap()
{
base.Table("fornecedor");
base.LazyLoad();
base.Id((FornecedorDb x) => (object)x.Id).GeneratedBy.Identity().Column("idfornecedor");
base.Map((FornecedorDb x) => (object)x.IdEmpresa).Column("idempresa").Not.Nullable();
base.Map((FornecedorDb x) => (object)x.IdCentro).Column("idcentro");
base.Map((FornecedorDb x) => (object)x.IdConta).Column("idconta");
base.Map((FornecedorDb x) => (object)x.IdPlano).Column("idcplanos");
base.Map((FornecedorDb x) => (object)x.TipoPagamento).CustomType<TipoPagamento>().Column("idtipopagto");
base.Map((FornecedorDb x) => x.Nome).Column("nome");
base.Map((FornecedorDb x) => x.Documento).Column("cpfcnpj");
base.Map((FornecedorDb x) => x.Cep).Column("cep");
base.Map((FornecedorDb x) => x.Cidade).Column("cidade");
base.Map((FornecedorDb x) => x.Estado).Column("uf");
base.Map((FornecedorDb x) => x.Bairro).Column("bairro");
base.Map((FornecedorDb x) => x.Endereco).Column("endereco");
base.Map((FornecedorDb x) => x.Numero).Column("numero");
base.Map((FornecedorDb x) => x.Complemento).Column("complemento");
base.Map((FornecedorDb x) => (object)x.TipoTelefone1).CustomType<TipoTelefone>().Column("idfonetipo1");
base.Map((FornecedorDb x) => x.Prefixo1).Column("ddd1");
base.Map((FornecedorDb x) => x.Telefone1).Column("fone1");
base.Map((FornecedorDb x) => (object)x.TipoTelefone2).CustomType<TipoTelefone>().Column("idfonetipo2");
base.Map((FornecedorDb x) => x.Prefixo2).Column("ddd2");
base.Map((FornecedorDb x) => x.Telefone2).Column("fone2");
base.Map((FornecedorDb x) => (object)x.Ativo).Column("Ativo");
base.Map((FornecedorDb x) => x.Email).Column("email");
base.Map((FornecedorDb x) => x.Observacao).CustomType("StringClob").CustomSqlType("varchar(MAX)");
}
}
}
|