summaryrefslogtreecommitdiff
path: root/Codemerx/Gestor.Infrastructure/Gestor.Infrastructure.Mappings.Seguros/SeguradoraContatoMap.cs
blob: 8c19c92958e7765c97c502d533db03dde36f11f4 (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
using FluentNHibernate.Mapping;
using Gestor.Infrastructure.Entities.Common;
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 SeguradoraContatoMap : ClassMap<SeguradoraContatoDb>
	{
		public SeguradoraContatoMap()
		{
			base.Table("ciacontato");
			base.LazyLoad();
			base.Id((SeguradoraContatoDb x) => (object)x.Id).GeneratedBy.Identity().Column("idciacontato");
			base.References<EmpresaDb>((SeguradoraContatoDb x) => x.Empresa).Column("idempresa").Not.Nullable().Fetch.Join();
			base.References<SeguradoraDb>((SeguradoraContatoDb x) => x.Seguradora).Column("idciaseg").Not.Nullable().Fetch.Join();
			base.Map((SeguradoraContatoDb x) => x.NomeContato).Column("nome");
			base.Map((SeguradoraContatoDb x) => (object)x.Tipo).CustomType<TipoTelefone>().Column("idfonetipo");
			base.Map((SeguradoraContatoDb x) => x.Prefixo).Column("ddd");
			base.Map((SeguradoraContatoDb x) => x.Numero).Column("fone");
			base.Map((SeguradoraContatoDb x) => x.Email).Column("email");
			base.Map((SeguradoraContatoDb x) => (object)x.TipoContato).CustomType<TipoContatoSeguradora>().Default("0");
		}
	}
}