Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 10 - Working With Data Using Entity Framework Core #5

Closed
chadgdotme opened this issue Nov 29, 2022 · 1 comment
Closed

Chapter 10 - Working With Data Using Entity Framework Core #5

chadgdotme opened this issue Nov 29, 2022 · 1 comment

Comments

@chadgdotme
Copy link

Please check that your issue is not already in the errata aka list of corrections and improvements. Please note that PRs will be ignored because code in the repo must match the print book already published. Please raise an issue instead so I can handle it appropriately. All issues will be entered into the errata once closed and fixed in the next book edition.

Chapter: 10
Page Number: 926 of Kindle edition
Section Title: Modifying data with EF Core
Problem to fix: Parameter name, type does not match argument name, type
Suggested solution: Change argument name, type
Other useful information e.g. OS, coding tools, and so on:

Hello! I believe I've spotted a slight error. In Program.Modifications.cs the method signature looks as such:

static void ListProducts(int[]? productIdsToHighlight = null)

However, when it's called from Program.cs (page 929 of Kindle edition) an int value is passed instead of int[]:

ListProducts(productIdToHightlight: resultAdd.productId);

Two problems as far as I can tell: The argument name passed is singular - productIdToHighlight vs productIdsToHighlight in the method signature. Also the value passed is int rather than int[] in the method signature.

To preserve the functionality of being able to pass in int[] values I changed the calling code to:

ListProducts(productIdsToHightlight: new int[] { resultAdd.productId });

Hopefully I'm correct about this!

@markjprice
Copy link
Owner

Hi,

Yes, you are correct. Thank you!

I have added this to the errata: https://github.com/markjprice/cs11dotnet7/blob/main/docs/errata/errata.md#page-477---inserting-entities

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants