Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7719005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:18:24+00:00 2026-06-01T03:18:24+00:00

I am using blow code for join in nhibernate, which is working fine. But

  • 0

I am using blow code for join in nhibernate, which is working fine. But i don’t wants to use .List on both queries before join, i wants to use .List after join. I don’t know nhibernate too much.. please provide me help that what i should make changes in below funciton to first join the data and then apply .List over it.

 public IEnumerable<PGrp> GetSol()
    {
        _pGrpR = null;
        _pGrp = null;

        QueryOver<Phy, Phy> activePhyQuery = GetDataQuery();

        var phyGrpR = _session.QueryOver(() => _pGrpR)
        .Where(
            Subqueries.WhereProperty<PGrpR>(p => _pGrpR.PhyId).In(
                activePhyQuery))
        .List<PGrpR>();

        IList<PGrp> pGrps = _session.QueryOver(() => _pGrp)
            .Where(x => !x.AC)
            .List<PGrp>();

        var newPGrps = pGrps
            .Join(
                pGrpR,
                p => p.Id,
                x => x.PGrpId,
                (p, x) => p
            ).Distinct().OrderBy(x => x.Name);

        return newPGrps;
    }

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T03:18:26+00:00Added an answer on June 1, 2026 at 3:18 am
     PGrpR pGrpR = null;
     IList<PGrp> pGrps = _session.QueryOver(() => _pGrp)
                .Where(x => !x.AC)
                .JoinAlias(pgrps => pgrps.pGrpR, () => pGrpR) // Set real property name
                .OrderBy(() => pGrpR.Name).Asc
                .Select(Projections.Distinct(Projections.Property(() => pGrpR."PropertyForDistinct")))
                .TransformUsing(Transformers.DistinctRootEntity)
                .List<PGrp>();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Iam using highslide js for my image blow up section and its working fine.
I need to design the blow given UI using a list view I have
Using PyObjC , you can use Python to write Cocoa applications for OS X.
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
iam using simple blow up trick in my page . first the div is
I am using a image blow up simply with an overlay image and the
I am wondering if using the keyword as in the following code is a
I am using SWFLoader to load a swf file. The code is below: <?xml
This will blow your mind... Check out http://blue-anvil.com/jquerycurvycorners/test.html using IE Curved corners look nice
Earlier I asked if using as in C# was safe (i.e. won't blow up):

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.