Skip to content

ayeshafatima977/Library-due-date-tracker

Repository files navigation

Project Name:

C# ASP.NET Core Practice - Library Due Date Tracker

Author:

Ayesha Fatima

Date Last Edited:

December 21st,2020

Purpose of the Project:

The purpose of the project is to create a tool that will help to keep track of all the books that are checked out of a library.

Technical Lessons Learnt 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.
  • 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.

Prerequisites

Installation

$ git clone https://github.com/ayeshafatima977/Library-Day3.git
$ cd Library-Day3
$ cd Library-Day3
$ 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

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.

Usage/Approach

  • Start the Debugging tool within Visual Studio 2019.
  • A browser will automatically open to show a view of the database.
Note:This is a Cumulative Assignment and Continuation of Library Day1 Library Day2

Please visit above links or visit Trello Board for full requirement of the project.

Trello Link:

  1. https://trello.com/b/2rbxpdVk/library-due-date-tracker-aspnet

References:

  1. MVC Review
  2. Add Data in Home Page
  3. Layout view
  4. Good resource for ASP .NET
  5. Date Time Today
  6. DateTime.AddDays
  7. DateTime? NULL value types
  8. Getter Only Auto properties
  9. Table Element
  10. Bootstrap Button Classes
  11. DateTime
  12. Loading Related Data
  13. DateTime Compare 14.Lambda Expressions
  14. BootStrap Typography
  15. Bootstrap Form fields
  16. Form
  17. BootStrap:Tables
  18. Format Syntax on GitHub