[ 
https://issues.apache.org/jira/browse/IGNITE-19260?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sergey Stronchinskiy updated IGNITE-19260:
------------------------------------------
    Description: 
Support nested member init projections:

 
{code:c#}
[Test]
public void TestSelectMemberInitSupportsFields1()
{
        var res = PocoView.AsQueryable()
                .Where(x => x.Key == 2)
                .Select(x => new MyClass1
                {
                        Key = x.Key,
                        Class2Prop = new MyClass2
                        {
                                Value = x.Val
                        }
                })
                .ToArray();

        Assert.AreEqual(1, res.Length);
        var resRow = res[0];
}

private class MyClass1
{
        public long Key { get; set; }

        public MyClass2 Class2Prop { get; set; } = null!;
}

private class MyClass2
{
        public string? Value { get; set; }
}
{code}




Also check possibility to combine with anonymous types.

  was:
Support nested member init projections:

 
{code:c#}
[Test]
public void TestSelectMemberInitSupportsFields1()
{
        var res = PocoView.AsQueryable()
                .Where(x => x.Key == 2)
                .Select(x => new MyClass1
                {
                        Key = x.Key,
                        Class1 = new MyClass2
                        {
                                Value = x.Val
                        }
                })
                .ToArray();

        Assert.AreEqual(1, res.Length);
        var resRow = res[0];
}

private class MyClass1
{
        public long Key { get; set; }

        public MyClass2 Class1 { get; set; } = null!;
}

private class MyClass2
{
        public string? Value { get; set; }
}
{code}




Also check possibility to combine with anonymous types.


> .NET: Thin 3.0: Support nested MemberInit projections in LINQ
> -------------------------------------------------------------
>
>                 Key: IGNITE-19260
>                 URL: https://issues.apache.org/jira/browse/IGNITE-19260
>             Project: Ignite
>          Issue Type: Improvement
>          Components: platforms
>            Reporter: Sergey Stronchinskiy
>            Assignee: Sergey Stronchinskiy
>            Priority: Major
>              Labels: .NET, LINQ, ignite-3
>
> Support nested member init projections:
>  
> {code:c#}
> [Test]
> public void TestSelectMemberInitSupportsFields1()
> {
>       var res = PocoView.AsQueryable()
>               .Where(x => x.Key == 2)
>               .Select(x => new MyClass1
>               {
>                       Key = x.Key,
>                       Class2Prop = new MyClass2
>                       {
>                               Value = x.Val
>                       }
>               })
>               .ToArray();
>       Assert.AreEqual(1, res.Length);
>       var resRow = res[0];
> }
> private class MyClass1
> {
>       public long Key { get; set; }
>       public MyClass2 Class2Prop { get; set; } = null!;
> }
> private class MyClass2
> {
>       public string? Value { get; set; }
> }
> {code}
> Also check possibility to combine with anonymous types.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to