summaryrefslogtreecommitdiff
path: root/Codemerx/Gestor.Infrastructure/Gestor.Infrastructure.Mappings.Seguros/PerfilMap.cs
blob: 1729b6bfcdbeb265d8c6976d2702e2ad4b4770b0 (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
43
44
45
using FluentNHibernate.Mapping;
using Gestor.Infrastructure.Entities.Generic;
using Gestor.Infrastructure.Entities.Seguros;
using System;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;

namespace Gestor.Infrastructure.Mappings.Seguros
{
	public class PerfilMap : ClassMap<PerfilDb>
	{
		public PerfilMap()
		{
			base.Table("perfil");
			base.LazyLoad();
			base.Id((PerfilDb x) => (object)x.Id).GeneratedBy.Identity().Column("idperfil");
			base.References<ClienteDb>((PerfilDb x) => x.Cliente).Column("idcliente").Not.Nullable().Fetch.Join();
			base.References<ControleDb>((PerfilDb x) => x.Controle).Column("idcontrole").Not.Nullable().Fetch.Join();
			base.Map((PerfilDb x) => x.Nome).Column("nomecompleto").Not.Nullable();
			base.Map((PerfilDb x) => (object)x.Relacao).CustomType<CustomEnumType<Relacao>>().Column("relacao");
			base.Map((PerfilDb x) => x.CepPernoite).Column("ceppernoite");
			base.Map((PerfilDb x) => x.CepCirculacao).Column("cepcirculacao");
			base.Map((PerfilDb x) => x.KmMensal).Column("quilometragemmensal");
			base.Map((PerfilDb x) => (object)x.UsoProfissional).Column("usoprofissional").CustomType<CustomBoolType>();
			base.Map((PerfilDb x) => (object)x.GaragemTrabalho).CustomType<CustomEnumType<GaragemTrabalhoEstudo>>().Column("garagemtrabalho");
			base.Map((PerfilDb x) => (object)x.GaragemEstudo).CustomType<CustomEnumType<GaragemTrabalhoEstudo>>().Column("garagemestudo");
			base.Map((PerfilDb x) => (object)x.GaragemResidencia).CustomType<CustomEnumType<GaragemResidencia>>().Column("garagemresidencia");
			base.Map((PerfilDb x) => (object)x.VeiculoResidencia).CustomType<CustomIntType>().Column("veiculosresidencia");
			base.Map((PerfilDb x) => (object)x.TipoResidencia).CustomType<CustomEnumType<TipoResidencia>>().Column("tiporesidencia");
			base.Map((PerfilDb x) => (object)x.UsoDependentes).CustomType<CustomEnumType<UsoDependetes>>().Column("usodependentes");
			base.Map((PerfilDb x) => (object)x.DistanciaResidenciaTrabalho).CustomType<CustomEnumType<DistanciaTrabalho>>().Column("distanciaresidenciatrabalho");
			base.Map((PerfilDb x) => (object)x.Ocupacao).CustomType<CustomEnumType<Ocupacao>>().Column("ocupacao");
			base.Map((PerfilDb x) => x.Cpf).Column("cpf");
			base.Map((PerfilDb x) => (object)x.Nascimento).Column("datanascimento");
			base.Map((PerfilDb x) => (object)x.Sexo).CustomType<CustomEnumType2<Sexo>>().Column("sexo");
			base.Map((PerfilDb x) => (object)x.TempoHabilitacao).CustomType<CustomEnumType<TempoHabilitacao>>().Column("tempohabilitacao");
			base.Map((PerfilDb x) => (object)x.EstadoCivil).CustomType<CustomEnumType<EstadoCivil>>().Column("estadocivil");
			base.Map((PerfilDb x) => x.Habilitacao).Column("numerohabilitacao");
			base.Map((PerfilDb x) => (object)x.Isencao).Column("isencao").CustomType<CustomBoolType>();
			base.Map((PerfilDb x) => (object)x.SeguroVida).Column("SeguroVida").CustomType<CustomBoolType>();
			base.Map((PerfilDb x) => (object)x.AntiFurto).CustomType<CustomEnumType<Antifurto>>().Column("antifurto");
			base.Map((PerfilDb x) => (object)x.EstenderCobertura).Column("EstenderCobertura");
		}
	}
}