0

안녕 queryover 사용 방법 (가입) ... 예를 NHibernate에 QUERYOVER

 if (!string.IsNullOrEmpty(ufResidencia)) 
     { 
      EnderecoProspect endProspectRes =null; 
      TipoEndereco tipoEndProspectRes = null; 

      query 
       .JoinQueryOver<EnderecoProspect>(x => x.Enderecos,() => endProspectRes) 
        .And(() => endProspectRes.Uf == ufResidencia) 
         .JoinQueryOver<TipoEndereco>(x => x.TipoEndereco,() => tipoEndProspectRes) 
          .And(() => tipoEndProspectRes.Descricao != "Fazenda"); 
     } 

     if (!string.IsNullOrEmpty(ufFazenda)) 
     { 
      EnderecoProspect endProspectFaz = null; 
      TipoEndereco tipoEndProspectFaz = null; 

      query 
       .JoinQueryOver<EnderecoProspect>(x => x.Enderecos,() => endProspectFaz) 
        .And(() => endProspectFaz.Uf == ufFazenda) 
         .JoinQueryOver<TipoEndereco>(x => x.TipoEndereco,() => tipoEndProspectFaz) 
          .And(() => tipoEndProspectFaz.Descricao == "Fazenda"); 

     } 

내가 경로가 중복된다는 메시지가 실행하려고

.

답변

3

별칭

EnderecoProspect additionalProspect = null; 

query 
    .JoinQueryOver<EndercoProspect>(x => x.Endercos,() => additionalProspect)... 
를 사용해보십시오