You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Sergey Stronchinskiy (Jira)" <ji...@apache.org> on 2023/04/08 13:38:00 UTC
[jira] [Updated] (IGNITE-19260) .NET: Thin 3.0: Support nested MemberInit projections in LINQ
[ 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:java}
[Test]
public void TestSelectMemberInitSupportsFields1()
{
var res = PocoView.AsQueryable()
.Where(x => x.Key == 2)
.Select(x => new MyClass1
{
Key = x.Key,
Class2Field = 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 Class2Field { 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:
```csharp
[Test]
public void TestSelectMemberInitSupportsFields1()
{
var res = PocoView.AsQueryable()
.Where(x => x.Key == 2)
.Select(x => new MyClass1
{
Key = x.Key,
Class2Field = 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 Class2Field { get; set; } = null!;
}
private class MyClass2
{
public string? Value { get; set; }
}
```
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:java}
> [Test]
> public void TestSelectMemberInitSupportsFields1()
> {
> var res = PocoView.AsQueryable()
> .Where(x => x.Key == 2)
> .Select(x => new MyClass1
> {
> Key = x.Key,
> Class2Field = 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 Class2Field { 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)