Giter Site home page Giter Site logo

launchcode-education-archived / csharp-web-development Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 9.0 33.43 MB

Unit 2 (C# Track) of the LC101 Curriculum, following fundamentals in JavaScript

Home Page: https://education.launchcode.org/csharp-web-development/

License: GNU General Public License v3.0

Shell 0.38% Python 8.20% CSS 86.64% HTML 4.78%

csharp-web-development's People

Contributors

ahotal01 avatar carlylanglois avatar cfreylc avatar chrisbay avatar codinglikeagirl42 avatar dependabot[bot] avatar gildedgardenia avatar jimflores5 avatar jwoolbright23 avatar pdmxdd avatar scottkuhl avatar speudusa avatar the-vampiire avatar welzie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

csharp-web-development's Issues

Research additional comment type

From PR opened by Scott, "Also, I did not add this because it might be covered later, but there is an additional type of comment that is meant to document the code and provide IntelliSense support. You get this when you use three slashes above a method, class or property.

///

/// Convert Fahrenheit into Celsius.
///
public static void Main(string[] args)"

Want to further investigate before adding into book.

Chapter 20 Notes

Many-to-Many relationship mapping is about to get a major upgrade in .NET 5 releasing later this year. You will no longer need a class for the join table.
dotnet/efcore#19003

This is the simplest writeup I have seen so far on the change:
https://daveabrock.com/2020/08/29/dotnet-stacks-14

BTW, just a reminder on my previous notes that will affect a lot of the content. .NET Core in v5 will now just be .NET going forward. Core has been dropped from the name.

GA 3 TechJobs MVC Edition

I think it would be helpful to include a link to the working demo so that learners Know what it should look like. I noticed it is included in the JAVA edition. We have a link in the solution that the TA's can access but the link isnt included for the learners. Also the link was working, but lately it is not: https://lc-java-3-demo.herokuapp.com/ (An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command)

Chapter 21 Notes

Something that is missing from this chapter is how to map the application user to tables in the database. For example, how do you add a property to the event examples that shows which user created the event. This is a scenario the students almost always run into on their projects.

Another thing the users run into is how to change from always displaying the email address as the user and instead collect the user's name. This prevents all other users from seeing everyone's email address.

I cover this scenario here: https://medium.com/@scottkuhl/extending-asp-net-core-2-2-identity-management-c3cc657cc448

Authentication and Authorization

At some point the projects need to include identity management. This includes a project that has users register and log in and maybe how to make minor extensions to it like capturing the users first and last name. The project should also connect the classes they create, like a pizza order, to the classes that are part of the identity framework, like tracking which user placed the order. Almost all student projects require this feature and they end up struggling with it instead of focusing on their project.

It looks like the Java track includes this, so I am hoping we can get it into the C# track as well.

Identity management documentation.

A guide I created for extending Identity Management.

Chapter 10 Notes

The videos and matching repository were created with Visual Studio for Mac. It seems highly likely that most students will be using Windows. Should these videos be changed to the Windows version?

On Windows the default debugging experience is going to be IIS Express and not Kestrel. So, the localhost:5000 and localhost:5001 are not going to be correct. It's going to be a bizarre random port instead. If you look in the launchSettings.json file you will see what I mean.

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:61846",
      "sslPort": 44312
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "DOTNET_ENVIRONMENT": "Development"
      }
    },
    "CleanArchitecture.WebUI": {
      "commandName": "Project",
      "launchBrowser": true,
      "applicationUrl": "https://localhost:5001;http://localhost:5000",
      "environmentVariables": {
        "DOTNET_ENVIRONMENT": "Development"
      }
    }
  }
}

This is one of the big differences between Mac and Windows. The Windows users can run the Kestrel version, but they need to change this from IIS Express to the Project Name.

image

The links to Microsoft documentation have version 3.1 of ASP.NET Core in the query string. I don't know if this was intentional. (I found a similar link in Chapter 13, I'll assume this is a documentation wide issue.)

[Troubleshooting] HTTP Error 500.0 when following book instructions (chp 9 reading and assignment)

From a TA:

Several of our students are getting this error when they're following the instructions in the book:
HTTP Error 500.0 - ANCM In-Process Handler Load Failure

The fix I have found for this is to change the drop down at the top of Visual Studio next to Any CPU from IIS Express to HelloAspDotNet (or whatever they named their project).

It's happened often enough that I wonder if it should be in the troubleshooting section of the book.

Slack conversation

Chp 9 student comment:

Working through Ch 9 reading and when I hit IIS Express in VS I get this message on the page (HTTP Error 500.0 - ANCM In-Process Handler Load Failure) instead of the Welcome page that shows in the book. Any idea why that is happening? I followed all the steps in the book, trying to access localhost on Chrome.

Proposed Fix from TA:

The fix is to change the web server running your code. To do that:Change the drop down at the top of Visual Studio next to Any CPU (is where it will be on most people's VS) from IIS Express to HelloAspDotNet (or whatever you named your project). Here's a screenshot of what that looks like on mine:

image

MVC Design Pattern

ASP.NET has gone through several patterns for UI development, and these are just the official ones from Microsoft.

  1. Web Forms
  2. MVC
  3. Razor Pages
  4. Blazor

Microsoft has been pushing harder on adoption of Razor Pages as the successor to MVC for a few years now. It's easier for people new to programming and those coming from Web Forms to learn. If you are not familiar with Razor Pages, it is very similar to MVC but combines the View, Model and Controller into the same folder as a View, Code Behind and Page Model.

Blazor is a C# based SPA like Angular, React, Vue etc. that has been getting the lion's share of attention from the ASP.NET team and Microsoft's partners lately. It produces a much more modern web application framework based on open standards like web assembly without the need to write JavaScript.

Is it possible for LaunchCode to reach out to its partners that hire graduates to find out what the market is looking for right now? I would be interested to know if LaunchCode should still be focusing on MVC or should start to migrate to another UI model when teaching.

xUnit

Chapter 6 covers unit testing with MSTest. This test framework has mostly fallen out of favor since .NET Core with a much greater emphasis on xUnit. The two frameworks are very similar but the latter is more closely aligned with non-Microsoft industry standards.

What do you think about converting this chapter over?

Chapter 19 Notes

Naming conventions in the database are not consistent. The fields are Pascal Case but the tables are Lower Case. In the previous chapters, tables and fields were both Snake Case. I think in this chapter it should at least follow the Pascal Case naming convention consistently.

Passwords in the connection string may trip security bot warnings when the students check in their code to GitHub. I don't have a good AND easy way around this. If it was SQL Server on Windows we could change the type of connection to Integrated Authentication and not need a user name and password. In this case, the proper way to handle this connection with a password is with an App Secret.

Thank you for using Id and not ID. That's just a personal pet peeve of mine. ;)

As a best practice, students should be using SaveChangesAsync and not SaveChanges, but that may be beyond the scope of this course. Maybe worth mentioning as a note?

Another best practice that is not mentioned for web apps is to always use .AsNoTracking when retrieving data that is not going to be updated which is most of the time. This adds a large amount of overhead in EF when populating lists.

14.5. Exercises: Edit Model Classes

When the students click on the "Check your Solution" for Step 3 of this exercise there seems to be a mistake as it shows
[HttpPost]
[Route("Events/Edit/{eventId}")]
public IActionResult Edit(int eventId)
{
// controller code will go here
}

But this should be an [HttpGet]...so some learners got caught up on using what the "Check your solution" showed and it caused problems

GA3 starter code for Search Index VIew

A student noticed that the "all" radio button does not stay checked as was intended and even mentioned in the Bonus for this assignment. She caught the error in this line that wasn't working: line 12 in the search index view
@@

her fix:

<input type="radio" name="searchType" id="@column.Key" value="@column.Key" checked=@(column.Key == "all") />

GA 2 Test Task 4 instructions/tests

In graded assignment 2, Tech Jobs-OO, the last instructions of Test Task 4 states "Run your TestTask4 unit tests. Refactor your code as needed. Do not move onto Task 5 until you have passed all of Task 4’s auto-grading unit tests." However the last 3 tests in Test Task 4 all have to do with the ToString() method, which is refactored in Test Task 5. Therefore these test will continue to fail until moving on to Test Task 5. I am not sure if instructions need to change or tests should be moved to Test Task 5.

GA2: Running the Auto-grading Tests for Mac

At least one learner and I have encountered that the instructions and screenshots in "Running the Auto-grading Tests" do not match what we see in Visual Studio for Mac.

  1. (minor) "Run Unit Tests" is located under the Debug menu, not the Run menu
  2. (more important) No tests can be detected and run until the project compiles successfully, which requires commenting out TestTask3.cs until TestTask2.cs is completed. Suggest starting with TestTask3.cs commented out, as the other future tasks are, and updating the instructions accordingly.

3.4: Confusing Planets List

Link

https://education.launchcode.org/csharp-web-development/chapters/control-flow-and-collections/list.html#list-methods

Description

In the section on List Methods, we use a list of planets to demo different methods and how devs can use them. At the end of this section, we say that the count of our planets list would be 9. This is because in the table of methods we add "Pluto" to the list, however, it reads as though the students should be looking at the code sample above the table with 8 planets. Some clarification might need to be added the text as to whether they should look at the list after the table or in the code sample.

13.11. Studio: Spa Day Starter Code

lines 6-9 in Views/Spa/Menu.cshtml starter code seem to be redundant. Not sure if it's there for a reason, it's not in the solution code, Could be confusing for learners when the instructions say "...there are two div elements. Let’s add some children to the div with the id, clientProfile" , because they will see two divs that look like that (same with the the empty div with the id, servicesMenu.)

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.