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 { public ControleMap() { base.Table("controle"); base.LazyLoad(); base.Id((ControleDb x) => (object)x.Id).GeneratedBy.Identity().Column("idcontrole"); base.References((ControleDb x) => x.Cliente).Column("idcliente").Not.Nullable().Fetch.Join(); base.References((ControleDb x) => x.Seguradora).Column("idciaseg").Fetch.Join(); base.References((ControleDb x) => x.Ramo).Column("idramo").Fetch.Join(); base.References((ControleDb x) => x.Produto).Column("idproduto").Fetch.Join(); base.References((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((ControleDb x) => x.Documentos).Fetch.Join(); } } }