GithubHelp home page GithubHelp logo

markjprice / cs12dotnet8 Goto Github PK

View Code? Open in Web Editor NEW
388.0 388.0 102.0 49.68 MB

Repository for the Packt Publishing book titled "C# 12 and .NET 8 - Modern Cross-Platform Development Fundamentals" by Mark J. Price

PowerShell 0.25% C# 82.16% Smalltalk 0.14% HTML 13.77% CSS 3.63% JavaScript 0.06%

cs12dotnet8's Introduction

Hi there 👋, I am Mark J. Price. Author. Programmer. Teacher.

  • 📖 You can get my books from Amazon or my publisher Packt or any good book store.
  • 🤔 I’m currently working on the .NET 8 editions of my best selling books, C# 12 and .NET 8 - Modern Cross-Platform Development Fundamentals, scheduled to publish on November 14, 2023, the 2nd edition of my book, Apps and Services with .NET 8, scheduled to publish on December 12, 2023, and Tools and Skills for .NET 8 Pros, coming in 2024.
  • 🌱 You can read a Q&A with me.
  • 💬 Ask me about any issues that you might be having with the code in my books.
  • 📫 How to reach me: markjprice is also my Gmail account name.
  • ⚡ Michelle McNamara: "It’s chaos. Be kind."
  • 🦣 I am on Mastodon.

What you should know about me

An ex-Microsoft Certified Trainer (MCT) with more than 30 years’ experience in the IT industry, including two years working full-time for Microsoft’s Training and Certification group in Redmond, USA, I specialize in training that leads to developer certifications.

I am eager to lead programming students, both experienced and new, into the challenging worlds of web, cloud, and mobile computing using a rare combination of thirty years’ education experience coupled with real world consulting and developing production systems for enterprises worldwide.

  • I live in Wiltshire, England.
  • I'm experienced in the practical use of Microsoft developer tools and technologies.
  • I'm dedicated to enthusiastic and dynamic training as a means of nurturing a lifelong love of programming.
  • I design, write, and deliver standardized and custom programming courses.
  • I'm adaptable and deal well with ambiguity in organizations of varying sizes and cultures.
  • I hold an Honours Bachelor’s Degree in Computer Science.

I have written a trilogy of guided learning books about C# and .NET:

See all my books on Amazon or Packt's website.

Education and Certification

Highly qualified and experienced.

Microsoft Certified Solutions Developer (MCSD)

Web Applications, Universal Windows Platform, Windows Store Apps Using C#, SharePoint Developer

Microsoft Specialist

Programming in C#, Programming in HTML5 with JavaScript & CSS3, Developing Microsoft Azure Solutions, Architecting Microsoft Azure Solutions

Microsoft Certified Trainer (MCT)

1993 - 2017

Computer Science (BSc. Hons.)

University of Bristol, June 1993

Professional Scrum Master I

Since January 2016

Google App Engine Qualified Developer

One of less than one hundred worldwide.

cs12dotnet8's People

Contributors

markjprice avatar netcamo avatar tchial0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cs12dotnet8's Issues

Page 383, # 5. => Runtime Identifiers

Dear Mark,

the following runntime identifiers are not working (compiler error):

win10-x64 // should be win-x64?
win10-arm64 // should be win-arm64?
osx.11.0-arm64 // should be osx-arm64?

Source

Thanks,
Robin

Raising issues with the book, 35, 3

----- Helpful information -----

Code Editor: Visual Studio 2022
Code: n/a as no problem exists
Behavior Description: n/a
Screenshot: n/a

----- Less relevant but helpful information below -----
Operating System: Windows 11 64-bit
Hardware: Intel core i5 (that's all I am providing for now)

Just doing the step 3 on page 35 of the book. Keep cool and carry on. :)

Missing "{}" in code for compressing streams files?

Hello ,Mark.
In the code refering to the "decompressor" section, you ommit the {} after using (decompressor) and after using (XmlReader reader = ...)
Is that a delibarate action?
I'm raising this issue because in the "compress" section above you did used those {} around the using statements...
I think a clarification would be in order here.
I undersatand the code, but missed the meaning for those missing {}... in the decompress section of this code.

 using (decompressor)
    // no curly braces? Why?
    using (XmlReader reader = XmlReader.Create(decompressor))

vs

using (compressor)
    {
      using (XmlWriter xml = XmlWriter.Create(compressor))
      {

By the way, when I added the curly braces on the using(decompressor), the output of the Reader missed the first entry... removing the {}, all came back to "normal".

Page 95 Exploring more about console apps typo

In line 7 it says create a new console app using F# language and there is a cmd instruction to create that console app dotnet new console -lang "F#" --name "ExploringConsole" I think F# needs to be changed into C# according to book topic, content at current page and the next pages.

Answers to Knowledge Questions

Where are the answers to the knowledge questions in Chapter 2 and all? I've looked thoroughly through the readme sections and others but cannot find it.

Arrow left

In Chapter 02 Speaking C# > Understanding C# grammar and vocabulary > Blocks:

Code editors like Visual Studio 2022 and Visual Studio Code provide a handy feature to collapse and expand
blocks by toggling the [-] or [+] or an arrow symbol pointing down or left when you move your mouse cursor
over the left margin of the code

It should read pointing down or right.
Thank you Mark 👍

Page 495, 7. => CurrentDirectory,

Dear Mark,

possibly

string path = Combine(CurrentDirectory, "people.xml");

should be changed to

string path = Combine(Directory.GetCurrentDirectory(), "people.xml");

The same on page 499, 3.

Thanks,
Robin

Some Information Left From the Previous Topic

Chapter: 8
Title: Generating GUIDs
Page: 421

There seems to be some confusion in step one. It says to add statements to access a shared Random instance and use its methods to generate random numbers. I'm not sure how this relates to generating a GUID, especially considering the code provided.

Q: Example page 79

Dear Mark,

Page 79, example at the bottom:

string json = $$"""
            {
            "first name": "{{person.Firstname}}",
            "age": "{{person.Age}}",
            "calculation": "{{{1 + 2}}}"
            }
            """;

Why does "calculation" 1+2 has three curly braces? It's working with two as well and I found no explanation why the example uses three.
Mistake or intentional?

Great book, I love it!

Thanks,
Robin

Page 261 typo

Hi Mark,

There is an extra space in the code snippet on page 261 in the list of parameters for OptionalParameters method:
string command = "Run!"

Best,
Vlad

Cannot find tables

Hello Mark,
Relating to Chapter 10:
I got this message after issuing the dotnet ef scaffold command copied from your Github:

F:\EF core Learning\Chapter10\WorkingWithEFCore>dotnet ef dbcontext scaffold "Data Source=Northwind.db" Microsoft.EntityFrameworkCore.Sqlite --table Categories --table Products --output-dir AutoGenModels --namespace WorkingWithEFCore.AutoGen --data-annotations --context NorthwindDb

This is what I got:

To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263.
Unable to find a table in the database matching the selected table 'Categories'.
Unable to find a table in the database matching the selected table 'Products'.

Tried it from within VS2022 and from CMD - same results... :(

Helkp please,
Avri

Page 144

Hi Mark,

On the page 144, there is a comma for the last switch statement, at the end of the page: [...] => "Any items in any order.",
Even if the code is working like this, the comma gives you the feeling that something more will come.

Best,
Vlad

Chapter 13 HTTP/3 issue

Hi I'm following along with http/3 and I got everything set up. Chrome debug tools show h3 under Alt-Svc but the console shows HTTP/2 GET message. Is this a bug, or did I miss something I do have the code snippet in my Program.cs along with the using Microsoft.AspNetCore.Server.Kestrel.Core; I'm also running Windows 11.

builder.WebHost.ConfigureKestrel((context, options) =>
{
    options.ConfigureEndpointDefaults(listenOptions =>
    {
        listenOptions.Protocols = HttpProtocols.Http1AndHttp2AndHttp3;
        listenOptions.UseHttps(); // HTTP/3 requires secure connections.
    });
});

http3chromeImage
http3consoleImage

Minor issue in name of a preference

Hi Mark,

Hope this isn't too pedantic and apologies if it is.

Minorly incorrect string - that you might be interested in correcting going forward - in Chapter 1, page 43 on my Kindle, where you are discussing inline/inlay hints. The option you refer to as "Display inline parameter hint names" is "Display inline parameter name hints".

Easy error to roll with, no skin off my back, just figured you might want it flagged for ya.

Best,
Fumblebee

Writing mistake on page 124

Hi Mark,

My name is Vlad Meici. I am C# developer for 10 years and I am reading your book with enthusiasm to discover what is new in C# 12 and .NET 8. Even I am already familiar with most of the topics presented in the book, it`s always good to refresh your knowledge.

I raised this issue to tell you about the writing mistakes that I discovered on page 124 (section Exploring bitwise and binary shift operators):
In step 1 from page 123, you declared two variable x and y.
In step 3 from page 124, you refer to these variables as a and b:
"In Program.cs, add statements to output the results of the applying the left-shift operator to move the bits of the variable a by three columns, multiplying a by 8, and right-shifting the bits of the variable b by one column, as shown in the following code:"
Also, at the end of this section, there is a sentence where variable b appears again:
"The 3 result is because the 1 bits in b were shifted one column into the 2- and 1-bit columns"

I hope you find this useful.

Wish you a great day and happy coding,
Vlad

General question

Hello Mark,
I hope I fine you well.

I'm following and learning for you a lot. And I'm very thankful for that.
However, I'm trying to fit it all together with not much success.
Maybe I'm skipping something(s) along the way?
Maybe I should get your other books as well? Is there a textbook where I could find a comprehensive guide to actually build an app? From scratch, that is?

Please help me on my journey.

My best regards,
Avri

Problem in source code, but book listing is correct

In

code/Chapter02/Formatting/Program.cs

Line 24,

  "{0} {1} lived in {2} and worked in the {4} team at {5}."

the argument indices go beyond the number of arguments passed. Apparently the example used to have "Sweden" as an argument, but was removed. The code listing in the book is correct, but the file in the repo is incorrect.

Page 96, example 2.: Currency issue

Dear Mark,

page 96, example 2.:

Output is without curreny, but question mark:
12 apples cost 4,20 ?

Solution: Put the following lines on top for right encoding:

using System.Text;
Console.OutputEncoding = Encoding.Default;

Output now is with currency:
12 apples cost 4,20€

Thanks,
Robin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.