summaryrefslogtreecommitdiff
path: root/Gestor.Infrastructure/Gestor.Infrastructure.Mappings.Financeiro/PlanosMap.cs
blob: bbbbc2bf2c2539312afcc7eb1740a5e7c9db1cfa (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.Financeiro;
using Gestor.Infrastructure.Entities.Generic;
using Gestor.Infrastructure.Entities.Seguros;
using System;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;

namespace Gestor.Infrastructure.Mappings.Financeiro
{
	public class PlanosMap : ClassMap<PlanosDb>
	{
		public PlanosMap()
		{
			base.Table("cplanos");
			base.LazyLoad();
			base.Id((PlanosDb x) => (object)x.Id).GeneratedBy.Identity().Column("idcplanos");
			base.References<TipoContaDb>((PlanosDb x) => x.TipoConta).Column("idtipoconta");
			base.References<PlanoDb>((PlanosDb x) => x.Plano).Column("idcplano").Fetch.Join();
			base.Map((PlanosDb x) => x.Descricao).Column("descricao");
			base.Map((PlanosDb x) => (object)x.Sinal).Column("ctipo").CustomType<CustomEnumType<Sinal>>();
			base.Map((PlanosDb x) => (object)x.Ativo).Column("ativo").CustomType<CustomBoolType>();
		}
	}
}