English 中文(简体)
Trouble with RIA Services and lambda JOIN
原标题:Trouble with RIA Services and lambda JOIN

注:在下文的评论中,这一答复是重复的。

我在设法使区域影响评估服务机构收回我所需要的数据,而不是我所需要的数据。 我有一个家长目标(项目),其中包括一些儿童。 其中一个构成部分(每个项目一个构成部分)。 另一个是项目参与者,需要根据参与人名册加以限制,我还需要收集个人信息(与项目参与者有关)。

我此前曾尝试过一些法典:

public IQueryable<IMSModel.Project> GetProjectHierarchy(String id)
    {

        return this.ObjectContext.Projects
                .Include("Component")
                .Include("ProjectParticipants")
                .Include("ProjectParticipants.Person")
                .Where(p => p.Program.ProgramType.lookupName == "EVDBE" &&
                    p.ProjectOrgs.Any(po => po.orgId == id) &&
                    p.ProjectParticipants.Any(pp => (pp.postId == id)) &&
                    p.ProjectParticipants.Any(pp => pp.PersonStatus.lookupName == "A") &&
                    p.ProjectParticipants.Any(pp => pp.ParticipantRole.participantInd == "Y"))
                .OrderBy(p => new { p.fiscalYear, p.title })
                .OrderByDescending(p => p.fiscalYear);


    }

这太不好了,但我最后忘记了我不希望的项目参与者。 我真的想要做的是,项目参与者的物体仅限于那些有参与者的参与者。 Ind=“Y”。

我为此尝试了另一个可能的辛迪加,具体如下:

public IQueryable<IMSModel.Project> GetProjectHierarchy(String id)
    {

        return this.ObjectContext.Projects
            .Include("Component")
            .Join(this.ObjectContext.ProjectParticipants
                .Include("ProjectParticipants.Person")
                .Where(
                    pp => pp.ParticipantRole.participantInd == "Y" &&
                    pp.postId == id &&
                    pp.PersonStatus.lookupName == "A"
            )

            , p => p.id
            , pp => pp.projectId
            , (p, pp) => p )
            .Where(p => p.Program.ProgramType.lookupName == "EVDBE" 
                && p.ProjectOrgs.Any(po => po.orgId == id));

    }

我认为,这将与我可能想要的东西更接近。 唯一的问题是,我没有从我的等级树的角度回过任何东西。 由于每个记录都设置了空白处,但我的约束力没有显示任何信息,因此有些改动被退回。 第一个例子的约束力确实显示数据,而第二个指标(由于我不使用任何(a)项而设定的有限结果)则没有显示数据。

一段时间以来,我一直禁止我反对这一提议,不能解决。 任何援助都将是巨大的。

问题回答

暂无回答




相关问题
Howto get started with C# 4.0 and .NET 4.0?

I don t want to download Visual Studio 2010. How can I start studying (not developing real applications) C# 4.0 and .NET 4.0 with just a text editor? Can I just download C# 4.0 compiler and .NET 4.0 ...

Mocking Framework with C# 4.0 Support?

Anybody know of a mocking framework that supports C# 4.0? Doesn t matter which one ATM, just need something that will work.

Unit Testing interface contracts in C#

Using the Code Contracts tools available in VS2010 Beta 2, I have defined an interface, a contract class for that interface and two classes that implement the interface. Now when I come to test the ...

How to Iterate Through Array in C# Across Multiple Calls

We have an application where we need to de-serialize some data from one stream into multiple objects. The Data array represents a number of messages of variable length packed together. There are no ...

IronPython ScriptRuntime equivalent to CPython PYTHONPATH

The following import works inside ipy.exe prompt but fails using IronPython ScriptRuntime inside a C# 4.0 program. import ConfigParser C# code: using System; using System.Collections.Generic; using ...

i cant understand the following code

Matrix<float> trainData2 = trainData.GetRows(intVar >> 1, intVar, 1); intVar is integer type... please help me to understand this code.

热门标签