Skip to content

Commit d109a1e

Browse files
committed
Add TargetTypedNewExpressions.AllInOneExample project
1 parent 2a72e7f commit d109a1e

File tree

4 files changed

+80
-0
lines changed

4 files changed

+80
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using System;
2+
using System.Collections.Generic;
3+
4+
namespace TargetTypedNewExpressions.AllInOneExample
5+
{
6+
public class After
7+
{
8+
private readonly Dictionary<string, string> dictionary = new ();
9+
10+
protected List<After> Children { get; } = new ();
11+
12+
public IEnumerable<DateTime> GetDates()
13+
{
14+
IEnumerable<DateTime> dates = new DateTime[]
15+
{
16+
new (2021, 01, 23),
17+
new (2021, 02, 24),
18+
new (2021, 03, 25),
19+
new (2021, 04, 26),
20+
new (2021, 05, 27)
21+
};
22+
23+
SomeHelperLocalFunction(new (1999, 12, 13, 12, 0, 0));
24+
25+
return dates;
26+
27+
void SomeHelperLocalFunction(DateTime date)
28+
{
29+
}
30+
}
31+
}
32+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using System;
2+
using System.Collections.Generic;
3+
4+
namespace TargetTypedNewExpressions.AllInOneExample
5+
{
6+
public class Before
7+
{
8+
private readonly Dictionary<string, string> dictionary = new Dictionary<string, string>();
9+
10+
protected List<Before> Children { get; } = new List<Before>();
11+
12+
public IEnumerable<DateTime> GetDates()
13+
{
14+
IEnumerable<DateTime> dates = new DateTime[]
15+
{
16+
new DateTime(2021, 01, 23),
17+
new DateTime(2021, 02, 24),
18+
new DateTime(2021, 03, 25),
19+
new DateTime(2021, 04, 26),
20+
new DateTime(2021, 05, 27)
21+
};
22+
23+
SomeHelperLocalFunction(new DateTime(1999, 12, 13, 12, 0, 0));
24+
25+
return dates;
26+
27+
void SomeHelperLocalFunction(DateTime date)
28+
{
29+
}
30+
}
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net5.0</TargetFramework>
5+
</PropertyGroup>
6+
7+
</Project>

examples/TheWhyAndHowOfCSharp90.sln

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TopLevelStatements.NewHello
2929
EndProject
3030
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TopLevelStatements.AllInOneExample", "TopLevelStatements\TopLevelStatements.AllInOneExample\TopLevelStatements.AllInOneExample.csproj", "{D0D6B130-5B4C-4A87-9A14-104E3157CCF3}"
3131
EndProject
32+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TargetTypedNewExpressions", "TargetTypedNewExpressions", "{B5375167-C261-42FB-8E60-91ED49BF9FC7}"
33+
EndProject
34+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TargetTypedNewExpressions.AllInOneExample", "TargetTypedNewExpressions\TargetTypedNewExpressions.AllInOneExample\TargetTypedNewExpressions.AllInOneExample.csproj", "{D909E34F-D00E-4A5D-BC80-B8FBFAD79A17}"
35+
EndProject
3236
Global
3337
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3438
Debug|Any CPU = Debug|Any CPU
@@ -75,6 +79,10 @@ Global
7579
{D0D6B130-5B4C-4A87-9A14-104E3157CCF3}.Debug|Any CPU.Build.0 = Debug|Any CPU
7680
{D0D6B130-5B4C-4A87-9A14-104E3157CCF3}.Release|Any CPU.ActiveCfg = Release|Any CPU
7781
{D0D6B130-5B4C-4A87-9A14-104E3157CCF3}.Release|Any CPU.Build.0 = Release|Any CPU
82+
{D909E34F-D00E-4A5D-BC80-B8FBFAD79A17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
83+
{D909E34F-D00E-4A5D-BC80-B8FBFAD79A17}.Debug|Any CPU.Build.0 = Debug|Any CPU
84+
{D909E34F-D00E-4A5D-BC80-B8FBFAD79A17}.Release|Any CPU.ActiveCfg = Release|Any CPU
85+
{D909E34F-D00E-4A5D-BC80-B8FBFAD79A17}.Release|Any CPU.Build.0 = Release|Any CPU
7886
EndGlobalSection
7987
GlobalSection(SolutionProperties) = preSolution
8088
HideSolutionNode = FALSE
@@ -90,6 +98,7 @@ Global
9098
{1431BE5B-FE26-40B9-813A-2200D63F8D01} = {4C21E675-A422-4F69-AD85-4C4F42FB7FA2}
9199
{26187725-8416-4751-8734-BDBC3B0DE00F} = {4C21E675-A422-4F69-AD85-4C4F42FB7FA2}
92100
{D0D6B130-5B4C-4A87-9A14-104E3157CCF3} = {4C21E675-A422-4F69-AD85-4C4F42FB7FA2}
101+
{D909E34F-D00E-4A5D-BC80-B8FBFAD79A17} = {B5375167-C261-42FB-8E60-91ED49BF9FC7}
93102
EndGlobalSection
94103
GlobalSection(ExtensibilityGlobals) = postSolution
95104
SolutionGuid = {4013E507-C6DF-4F41-BCF0-6B6F2A12A0A3}

0 commit comments

Comments
 (0)