summaryrefslogtreecommitdiff
path: root/Codemerx/Gestor.Infrastructure/Gestor.Infrastructure.Mappings.Seguros/RestricaoUsuarioMap.cs
blob: 0e9fdc06858d8979b49d54c6fea899da298b5c8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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 RestricaoUsuarioMap : ClassMap<RestricaoUsuarioDb>
	{
		public RestricaoUsuarioMap()
		{
			base.Table("RestricaoUsuario");
			base.LazyLoad();
			base.Id((RestricaoUsuarioDb x) => (object)x.Id).GeneratedBy.Identity().Column("Id");
			base.References<UsuarioDb>((RestricaoUsuarioDb x) => x.Usuario).Column("IdUsuario").Not.Nullable().Fetch.Join();
			base.Map((RestricaoUsuarioDb x) => (object)x.Tipo).CustomType<TipoRestricao>().Column("Tipo");
			base.Map((RestricaoUsuarioDb x) => (object)x.Restricao).Column("Restricao");
		}
	}
}