CSE 325: .NET Software Development

W01 Assignment: Build .NET Applications with C#

Overview

The objective is to briefly review C# syntax, introduce .NET, create a .NET project working with dependencies, debug, and create a web API with ASP.NET Core controllers that implement basic CRUD logic. Use the current .NET LTS SDK for all module work and assignment artifacts.

The content of this module comes from the learn.microsoft.com learning path content.

Instructions

  1. Complete the following "Build .NET Applications with C#" Microsoft learning modules in the order provided.
    Optional: If you establish a free profile account with Microsoft, your learn.microsoft.com progress will be tracked and you can earn badges and experience points (XP) as you work through any of their tutorials and challenges.
    Environment requirement: Complete this assignment with the .NET 8 LTS SDK. If your local environment differs from module screenshots, follow current .NET 8 commands and templates.
    1. Write your first C# code – Get started by writing code examples to review the basics of the C# syntax.
      Need to spend more time refreshing with the C# programming language?
      Consider these C# refresher modules.
    2. Introduction to .NET – Start learning about .NET. Understand what .NET is and how it works, and quickly build a small app in a web-based .NET environment.
    3. Create a new .NET project and work with dependencies – Use dependencies from the NuGet registry to develop .NET applications faster. Learn how to manage dependencies for your project.
    4. Interactively debug .NET apps with the Visual Studio Code debugger – Learn how to efficiently debug your .NET app by using Visual Studio Code to fix your bugs quickly.
    5. Work with files and directories in a .NET app – Build an app that manipulates files and directories with C# and .NET.
    6. Create a web API with ASP.NET Core controllers – Create a RESTful service with ASP.NET Core controllers that supports create, read, update, delete (CRUD) operations.
    7. Add at least one additional record to the Create a web API with ASP.NET Core controllers module in the Pizzas List.
    8. Verify API behavior by testing a working request and response example for each operation: GET, POST, PUT, and DELETE. Include the returned status code for each example.
  2. Add an additional function to the Work with files and directories in a .NET app module that generates a sales summary report file. The file should contain simple text that shows the actual sales total from the file and a detailed report of each file's total sales.
    Here is an example:
    Sales Summary
    ----------------------------
     Total Sales: $x,xxx,xxx.xx
    
     Details:
      filename: $xxx,xxx.xx
      filename: $xxx,xxx.xx
      ... etc.
    

    Using a StringBuilder object to build the report is OK.
    Remember that in C# you can format numbers as currency with the ToString("C") or string interpolation var:C method.

Submission

  1. Submit a link to your repository containing your working assignment code and include a short notes document (.md or .txt) in the repository root with the following two items:
    1. Evidence from the end of the module Create a web API with ASP.NET Core controllers showing the existing content, and your additional record.
    2. A text copy of your working sales summary function for Part 2.