Giter Club home page Giter Club logo

Comments (4)

jeremydmiller avatar jeremydmiller commented on August 29, 2024

@kacey90 Hey, you've really got to provide more detail about this for us to have any possible chance of addressing your issue. I can't even see what your queries were. And can you please paste in code and/or exception messages instead of screen shots next time? That would be much more helpful.

from marten.

kacey90 avatar kacey90 commented on August 29, 2024

@jeremydmiller Forgive me.

var results = await _querySession
    .Query<MemberKycVerificationStep>()
    .Where(x => x.MemberId == request.UserId)
    .Select(x => new MemberKycVerificationStepDto
    {
        KycVerificationStepId = x.KycVerificationStepId,
        Name = x.KycVerificationStep.Name,
        DateUpdated = x.DateUpdated,
        Status = x.Status,
        MemberId = x.MemberId
    })
    .ToPagedListAsync(request.PageIndex, request.PageSize, cancellationToken);
return await Result<IPagedList<MemberKycVerificationStepDto>>.SuccessAsync(results);

The above snippet returns Name of MemberKycVerificationStepDto as null as shown in the first screenshot.

    .Query<MemberKycVerificationStep>()
    .Where(x => x.MemberId == request.UserId)
    .AsEnumerable()
    .Select(x => new MemberKycVerificationStepDto
    {
        KycVerificationStepId = x.KycVerificationStepId,
        Name = x.KycVerificationStep.Name,
        DateUpdated = x.DateUpdated,
        Status = x.Status,
        MemberId = x.MemberId
    })
    .ToList();

This on the other hand, works for my requirement where the Name parameter of MemberKycVerificationStepDto gets the expected value as displayed in second screenshot.
I hope it's clear enough.

from marten.

jeremydmiller avatar jeremydmiller commented on August 29, 2024

@kacey90 I'm sorry, I really just don't have enough bandwidth to parse out exactly what it is you're trying to say isn't working. Can you do this through a failing test maybe?

At a guess, I'm not sure if Name = x.KycVerificationStep.Name, would work as a deeply nested member. I think so, but not sure. Might need a real reproduction to help with this. As a workaround, you can always call ToList() before Select() so that it's done in memory.

from marten.

jeremydmiller avatar jeremydmiller commented on August 29, 2024

And sorry, but trying to repro this, I get a "works on my box"

from marten.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.