Water Drinking Logger

Introduction

Welcome to the world of Razor Pages! Razor pages is a “newer, simplified web application programming model. It removes much of the ceremony of ASP.NET MVC by adopting a file-based routing approach. Each Razor Pages file found under the Pages directory equates to an endpoint.” There’s a lot of discussion in the .NET world about the pros and cons of Razor Pages vs MVC. Here at the C# Academy, we will learn both design patterns, so you’re better prepared to get your first job and excel at it.

Another advantage of learning Razor Pages is that it uses Razor syntax, which is the same solution .NET uses for MVC and Blazor. That means that your knowledge will be applied in many different pieces of technology. If you’re hired to work with C#, you’ll most likely work with one of these at some stage. Even companies that use front-end frameworks such as Vue, React or Angular have applications using .NET front-end solutions as part of their domain. Your knowledge will go a long way.

Requirements

The requirements for this project are different than the ones in the Console Area. From what I’ve seen, being out in the world trying to figure out, as a beginner in C#, how Razor Pages or MVC work, just using the documentation or free tutorials, is very frustrating. As much as I like Microsoft’s documentation in general, it doesn’t seem to satisfy the needs of many beginners. For that reason, I put together a video tutorial with the basics of Razor Pages. As usual, it’s project-based. The business model should be very similar to our first couple of console Apps, the Habit Tracker, and the Coding Tracker. But in this video I’ll walk you through the project step-by-step. You might consider this “hand-holding”, and it is. But once you learn these basics, we will have project where you’ll have to implement different business cases using Razor Pages and MVC. Don’t worry, I won’t hold your hand for too long. 😁

  • Follow the Razor Project Tutorial in the link provided, creating a list of steps with notes you think are important.
  • Recreate the project, with a different business case. Track something different and use different styling. Time to be creative!!

What you'll learn

  • Don't forget to have all of your code on Github, ALWAYS
  • You'll come across many different files and pieces of code you've never seen. Study each one carefully, use the links in the resources area. You can find thorough explanations about each little piece of the code searching online.

Challenges

  • What if you want to allow split numbers? I.e. 2.25 cups of water, how would you change your data types?
  • How about letting the user decide between standard measures (big bottle, bottle, glass)
  • What if you want to have another habit being tracked in the same project? The limit to what you can create is the limit of your imagination.

Video Tutorial

Log in to mark this article as read and save your progress.
An unhandled error has occurred. Reload 🗙