First Razor Pages Website

Making my first Razor Pages Website was an exciting yet challenging experience. It was a cool experience to be able to bring a database to website form, however I also experienced some issues in the way I ultimately created the website.

My Website

My website is based off of a game that I play way too much, Backyard Sports Football 2007 for the Game Boy Advance. I’ve gotten into it because the gameplay is really simplistic and the games don’t take too long to play. I’ve also been spending time trying to metagame it and quantify the worst and the best players in the game. This website is meant to sort all the characters by their attributes and positions in which they work best on the field.

The Simple Parts

It was really easy to initialize a website. I’m talking ridiculously easily. Using the command dotnet new webapp -o {insert folder name here} a Razor Pages is very easily and quickly created.

I also thought that creating a model was very easy, besides an issue I ran across that I will explain later. Scaffolding said model was also relatively easy (provided you don’t forget to create the key like I did). Validating each attribute properly wasn’t too much of a struggle for me either, however, I didn’t really have attributes that were too complicated.

The Difficult Parts

Updating an already created model was not as easy as adding a new one as was outlined in Part 7 of the tutorial. I made a mistake in my personal site trying to make an enum for a few of my attributes. When trying to create a new Player, those attributes with enums needed to be selected via a drop-down menu, however I didn’t know how to add those to the site. Additionally, when I tried to revert my changes, I was forced to make a branch from an old commit and then making a pull request to the main branch.

I also struggled with searching by different categories. I wanted to sort by all available positions (offense, defense, and special teams), but I couldn’t find out how to add all three to the query, so currently they can only be queried via offensive positions.

Additionally, seeding the data was simple, but very tedious. This resulted in me only adding 10 of the 37 in-game characters as the default. At some point I would like to fix that, but I can’t make any guarantees.

Jekyll vs Razor

I think both the Jekyll and Razor frameworks are similar in their sense of automation. There isn’t a heavy sense of building something but moreso adding to something that is already built to make it your own. I think that Jekyll is easier to customize in terms of visuals, there is a main .css file that is very easy to modify, however Jekyll appears to have different design files for each page? I’m not entirely sure and I wouldn’t know where to find them.

Going forward, I’m excited to work with Razor as it is much more database-oriented, whereas Jekyll seems to be heavily blog-focused. I think I did a decent job with this site and I am confident in my ability to do the next one.