Skip to content

Commit 9f118ea

Browse files
committed
Add item for page 517
1 parent ed77740 commit 9f118ea

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

docs/errata/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ If you find any mistakes in the eighth edition, *C# 12 and .NET 8 - Modern Cross
44

55
[**Errata** (19 items)](errata.md): Typos, tool user interface and behavior changes, or mistakes in code that would cause a compilation error that prevents a successful build.
66

7-
[**Improvements** (22 items)](improvements.md): Changes to text or code that would improve the content. These are optional.
7+
[**Improvements** (23 items)](improvements.md): Changes to text or code that would improve the content. These are optional.
88

99
[**Common Mistakes** (6 items)](common-mistakes.md): These are some of the most common mistakes that a reader might encounter when trying to get code in book tasks to work, or when trying to write your own code.
1010

docs/errata/improvement-p517.png

78.7 KB
Loading

docs/errata/improvements.md

+24-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
**Improvements** (22 items)
1+
**Improvements** (23 items)
22

33
If you have suggestions for improvements, then please [raise an issue in this repository](https://github.com/markjprice/cs12dotnet8/issues) or email me at markjprice (at) gmail.com.
44

@@ -24,6 +24,7 @@ If you have suggestions for improvements, then please [raise an issue in this re
2424
- [Page 460 - Identifying ranges with the Range type](#page-460---identifying-ranges-with-the-range-type)
2525
- [Page 484 - Compressing streams](#page-484---compressing-streams)
2626
- [Page 493 - Serializing as XML](#page-493---serializing-as-xml)
27+
- [Page 517 - Using SQL Server or other SQL systems](#page-517---using-sql-server-or-other-sql-systems)
2728
- [Page 541 - Querying EF Core models](#page-541---querying-ef-core-models)
2829
- [Page 727 - Understanding Swagger](#page-727---understanding-swagger)
2930

@@ -602,6 +603,28 @@ In Step 2, I wrote, "In the project file, add elements to statically and globall
602603

603604
Some readers do not notice that they need to statically import `System.Environment` so in the next edition I will write, "In the project file, add elements to statically and globally import the `System.Console` (to use `ForegroundColor` and `WriteLine`), `System.Environment` (to use `CurrentDirectory`), and `System.IO.Path` classes (to use `Combine`, `GetFileName`, and `GetDirectoryName`)."
604605

606+
# Page 517 - Using SQL Server or other SQL systems
607+
608+
In the online instructions, I say to "add package references to the EF Core data provider for SQL Server and the ADO.NET Provider for SQL Server, and globally and statically import the `System.Console` class for all C# files, as shown in the following markup:"
609+
```xml
610+
<ItemGroup>
611+
<Using Include="System.Console" Static="true" />
612+
</ItemGroup>
613+
614+
<ItemGroup>
615+
<PackageReference Version="5.1.1" Include="Microsoft.Data.SqlClient" />
616+
<PackageReference Version="8.0.0" Include="Microsoft.EntityFrameworkCore.SqlServer" />
617+
</ItemGroup>
618+
```
619+
620+
But Microsoft discovered a vulnerability in versions `5.1.1`, `5.1.2`, and earlier. You should always use the most recent version of packages to make sure that any bugs have been fixed.
621+
622+
You can check for the most recent package versions at the following links: https://www.nuget.org/packages/Microsoft.Data.SqlClient#versions-body-tab and https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.SqlServer/#versions-body-tab.
623+
624+
If you do so, then you will notice the warning about a vulnerability with the packages up to early January 2024. Since January 9, 2024 the vulnerability has been fixed with versions `4.0.5`, `5.1.3`, and `5.2.0-preview5.24024.3`, as shown in the following screenshot:
625+
626+
![Vulnerable packages](improvement-p517.png)
627+
605628
# Page 541 - Querying EF Core models
606629

607630
> Thanks to **swissbobo** in this book's Discord channel for asking a question that prompted this improvement.

0 commit comments

Comments
 (0)