Skip to content

jia-von/asp-net-due-date-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 

Repository files navigation

C# ASP.NET Core Practice - Library

The goal of this assignment is meant for me to master ASP.NET Web Application (Model-View-Controller) and to use MVC to create a CRUD application. I have created a tool that keep track of book(s) checked out and returned to the library.

Throughout this exercise, I have successfully executed several concepts related to ASP.NET Web Application MVC:

  • The use of scaffold Author.cs model with MVC Controller with Views, using Entity Framework(EF) to create AuthorController.cs and Author Views. The views scaffolded are Create.cshtml, Delete.cshtml, Details.cshtml, Edit.cshtml, and Index.cshtml.
  • The creation of model context, LibraryContext.cs from scratch. I completed and created relational database between author and book using EF migrations within NuGet Package Manager Console.
  • The creation of BookController.cs from scratch using empty MVC controller class.
  • The creation of BookController and Views() from scratch using empty controller files.
  • The customization of views within cshtml type files.
  • The creation of customized Exceptions as ValidationExceptions.csto generate custom Exception messages.
  • The use of LINQ to conduct queries.

Installation

$ git clone https://github.com/jia-von/asp-net-due-date-tracker.git
$ cd asp-net-library-due-date-tracker-day-1-jia-von
$ cd Library
$ start devenv Library.sln

Use the NuGet Package Manager to install packages:

PM> dotnet add package Microsoft.EntityFrameworkCore.Design
PM> dotnet add package Pomelo.EntityFrameworkCore.MySQL
PM> dotnet add package Microsoft.EntityFrameworkCore.SqlServer

Initiate initial migration to create a database with data seeded.

PM> dotnet ef migrations add InitialCreation
PM> dotnet ef update database

The result of successful database migration and update is shown below in PHPMyAdmin localhost with the database name mvc_library.

DataBase

Author Table Book Table
Author Book

Usage/Approach

  • Start the Debugging tool within Visual Studio 2019.
  • A browser will autmatically open to show a view of the database.

Screenshots of the views are shown below

Create View List View
CreationView ListView
Details View Author Index View
DetailsView AuthorIndex

Note: AuthorController Index() view was created using scaffold, MVC Controller with Views, using Entity Framework.