summaryrefslogtreecommitdiff
path: root/Gestor.Infrastructure/Gestor.Infrastructure.Mappings.Seguros/ClienteTelefoneMap.cs
blob: 55ed216c8f4d025fdb2c7540be7e1cdaca01bdb8 (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
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 ClienteTelefoneMap : ClassMap<ClienteTelefoneDb>
	{
		public ClienteTelefoneMap()
		{
			base.Table("clitelefone");
			base.LazyLoad();
			base.Id((ClienteTelefoneDb x) => (object)x.Id).GeneratedBy.Identity().Column("idclitelefone");
			base.References<ClienteDb>((ClienteTelefoneDb x) => x.Cliente).Column("idcliente").Not.Nullable().Fetch.Join();
			base.Map((ClienteTelefoneDb x) => (object)x.Tipo).CustomType<TipoTelefone>().Column("tipo");
			base.Map((ClienteTelefoneDb x) => x.Prefixo).Column("ddd");
			base.Map((ClienteTelefoneDb x) => x.Numero).Column("fone");
			base.Map((ClienteTelefoneDb x) => x.Observacao).Column("obs").CustomType("StringClob").CustomSqlType("varchar(MAX)");
			base.Map((ClienteTelefoneDb x) => (object)x.Ordem).Column("ordem");
		}
	}
}