summaryrefslogtreecommitdiff
path: root/Gestor.Infrastructure/Gestor.Infrastructure.Mappings.Seguros/PermissaoUsuarioMap.cs
blob: eade5629a0a40bec5d5b274184252a08f9a250df (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 PermissaoUsuarioMap : ClassMap<PermissaoUsuarioDb>
	{
		public PermissaoUsuarioMap()
		{
			base.Table("PermissaoUsuario");
			base.LazyLoad();
			base.Id((PermissaoUsuarioDb x) => (object)x.Id).GeneratedBy.Identity().Column("Id");
			base.References<UsuarioDb>((PermissaoUsuarioDb x) => x.Usuario).Column("IdUsuario").Not.Nullable().Fetch.Join();
			base.Map((PermissaoUsuarioDb x) => (object)x.Tela).CustomType<TipoTela>().Column("Tela");
			base.Map((PermissaoUsuarioDb x) => (object)x.Consultar).Column("Consultar");
			base.Map((PermissaoUsuarioDb x) => (object)x.Incluir).Column("Incluir");
			base.Map((PermissaoUsuarioDb x) => (object)x.Alterar).Column("Alterar");
			base.Map((PermissaoUsuarioDb x) => (object)x.Excluir).Column("Excluir");
		}
	}
}