summaryrefslogtreecommitdiff
path: root/Codemerx/Gestor.Infrastructure/Gestor.Infrastructure.Mappings.Seguros/ControleMap.cs
blob: a1de969295ed93909f8271b80bb523fc196b1eab (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
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 ControleMap : ClassMap<ControleDb>
	{
		public ControleMap()
		{
			base.Table("controle");
			base.LazyLoad();
			base.Id((ControleDb x) => (object)x.Id).GeneratedBy.Identity().Column("idcontrole");
			base.References<ClienteDb>((ControleDb x) => x.Cliente).Column("idcliente").Not.Nullable().Fetch.Join();
			base.References<SeguradoraDb>((ControleDb x) => x.Seguradora).Column("idciaseg").Fetch.Join();
			base.References<RamoDb>((ControleDb x) => x.Ramo).Column("idramo").Fetch.Join();
			base.References<ProdutoDb>((ControleDb x) => x.Produto).Column("idproduto").Fetch.Join();
			base.References<SeguradoraDb>((ControleDb x) => x.SeguradoraAnterior).Column("idciasegant").NotFound.Ignore().Fetch.Join();
			base.Map((ControleDb x) => (object)x.IdEmpresa).Column("idempresa").Not.Nullable();
			base.Map((ControleDb x) => x.AssistenciaId);
			base.HasMany<DocumentoDb>((ControleDb x) => x.Documentos).Fetch.Join();
		}
	}
}