Skip to content
This repository was archived by the owner on Apr 11, 2021. It is now read-only.

Commit 33d7049

Browse files
Merge pull request #39 from ProfessionalCSharp/vs2017
VS 2017 updates, redo EF migrations
2 parents 7994b34 + 0ed8645 commit 33d7049

File tree

126 files changed

+24988
-25
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+24988
-25
lines changed

CSharp7/Readme.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Readme - Code Samples for Chapter 47, C# 7.0 - What's New!
2+
3+
This chapter contains the following code sample:
4+
5+
* CSharp7Samples
6+
7+
Get the downloadable book chapter: [C# 7.0 - What's New?](https://csharp.christiannagel.com/2017/04/03/csharp7/)
8+
9+
To build and run the .NET Core samples, please install
10+
* Visual Studio 2017 with the .NET Core workload
11+
12+
Please download and install the tools from [.NET Core downloads](https://www.microsoft.com/net/core#windows).
13+
14+
For code comments and issues please check [Professional C#'s GitHub Repository](https://github.com/ProfessionalCSharp/ProfessionalCSharp6)
15+
16+
Please check my blog [csharp.christiannagel.com](https://csharp.christiannagel.com "csharp.christiannagel.com") for additional information for topics covered in the book.
17+
18+
Thank you!

EntityFramework/EntityFrameworkSamples/BooksSampleWithDI/BooksSampleWithDI.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,4 @@
1111
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="1.1.0" />
1212
</ItemGroup>
1313

14-
<ItemGroup>
15-
<Folder Include="Properties\" />
16-
</ItemGroup>
17-
1814
</Project>

EntityFramework/EntityFrameworkSamples/ConflictHandlingSample/ConflictHandlingSample.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,4 @@
1010
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.1" />
1111
</ItemGroup>
1212

13-
<ItemGroup>
14-
<Folder Include="Properties\" />
15-
</ItemGroup>
16-
1713
</Project>

EntityFramework/EntityFrameworkSamples/CreateBooksDatabase/CreateBooksDatabase.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,4 @@
1010
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.1" />
1111
</ItemGroup>
1212

13-
<ItemGroup>
14-
<Folder Include="Properties\" />
15-
</ItemGroup>
16-
1713
</Project>

EntityFramework/EntityFrameworkSamples/MenusSample/MenusSample.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
<ItemGroup>
99
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="1.1.1" />
10+
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="1.1.1" />
1011
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.1" />
1112
</ItemGroup>
1213

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
1919
{
2020
MenuCardId = table.Column<int>(nullable: false)
2121
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
22-
Title = table.Column<string>(nullable: true)
22+
Title = table.Column<string>(maxLength: 50, nullable: true)
2323
},
2424
constraints: table =>
2525
{
@@ -35,7 +35,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
3535
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
3636
MenuCardId = table.Column<int>(nullable: false),
3737
Price = table.Column<decimal>(type: "Money", nullable: false),
38-
Text = table.Column<string>(nullable: true)
38+
Text = table.Column<string>(maxLength: 120, nullable: true)
3939
},
4040
constraints: table =>
4141
{

EntityFramework/EntityFrameworkSamples/MenusSample/Migrations/MenusContextModelSnapshot.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
1414
{
1515
modelBuilder
1616
.HasDefaultSchema("mc")
17-
.HasAnnotation("ProductVersion", "1.0.0-rc2-20901")
17+
.HasAnnotation("ProductVersion", "1.1.1")
1818
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
1919

2020
modelBuilder.Entity("MenusSample.Menu", b =>
@@ -28,7 +28,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
2828
.HasColumnType("Money");
2929

3030
b.Property<string>("Text")
31-
.HasAnnotation("MaxLength", 120);
31+
.HasMaxLength(120);
3232

3333
b.HasKey("MenuId");
3434

@@ -43,7 +43,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
4343
.ValueGeneratedOnAdd();
4444

4545
b.Property<string>("Title")
46-
.HasAnnotation("MaxLength", 50);
46+
.HasMaxLength(50);
4747

4848
b.HasKey("MenuCardId");
4949

@@ -52,8 +52,8 @@ protected override void BuildModel(ModelBuilder modelBuilder)
5252

5353
modelBuilder.Entity("MenusSample.Menu", b =>
5454
{
55-
b.HasOne("MenusSample.MenuCard")
56-
.WithMany()
55+
b.HasOne("MenusSample.MenuCard", "MenuCard")
56+
.WithMany("Menus")
5757
.HasForeignKey("MenuCardId")
5858
.OnDelete(DeleteBehavior.Cascade);
5959
});

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ Samples available for these chapters (sample folders):
5959
* Chapter 43 - WebHooks and SignalR (SignalRAndWebHooks) [Windows]
6060
* Chapter 44 - Windows Communication Foundation (WCF) [Windows]
6161
* Chapter 45 - Deploying Websites and Services (DeploymentWeb)
62+
* Chapter 46 - .NET Core with csproj - only for download (csproj)
63+
* Chapter 47 - C# 7.0 - What's New? - only for download (CSharp7)
64+
65+
Download the extra Chapters for [C# 7.0](https://csharp.christiannagel.com/2017/04/03/csharp7/) and .NET Core with csproj - coming soon!
6266

6367
You can find additional samples in the [More Samples repository](https://github.com/ProfessionalCSharp/MoreSamples).
6468

csproj/.vscode/launch.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": ".NET Core Launch (console)",
6+
"type": "coreclr",
7+
"request": "launch",
8+
"preLaunchTask": "build",
9+
"program": "${workspaceRoot}\\HelloWorld\\bin\\Debug\\netcoreapp1.1\\HelloWorld.dll",
10+
"args": [],
11+
"cwd": "${workspaceRoot}\\HelloWorld",
12+
"console": "internalConsole",
13+
"stopAtEntry": false,
14+
"internalConsoleOptions": "openOnSessionStart"
15+
},
16+
{
17+
"name": ".NET Core Attach",
18+
"type": "coreclr",
19+
"request": "attach",
20+
"processId": "${command:pickProcess}"
21+
}
22+
]
23+
}

0 commit comments

Comments
 (0)