To predict the rate of the fuel based on the following criteria: - Client Location (in-state or out-of-state) - Client history (existing customer with previous purchase or new) - Gallons requested - Company profit margin (%)
- ASP.NET CORE
- Entity Framework (LINQ)
- NUnit
- Moq Framework (For Mocking the Methods)
- Coverlet (For Code Coverage)
- The FuelQuoteApp_p1.Tests Project contains the Test files which contains Unit Test cases for the AccountController, ClientController, QuoteController and FuelQuoteProvider.cs files. Only these files contains the runnable code required for the project.
- In this project, we used Entity Framework which helps in creating the database, retrieval of the data and modifying the database. Entity Framework uses LINQ instead of SQL for querying the data from the database.
- We used Moq to mock the methods of FuelQuoteRepository for testing the FuelQuoteProvider methods (As these methods use the methods in FuelQuoteRepository). The controllers can not access the database directly (Abstraction and Data Security).
The flow is : Controllers => Provider => Repository => Database - We added the project FuelQuoteApp_p1.BusinessLayer, it will be updated with the logics for all the modules in the upcoming assignments.
- Password Encryption : We used ASP.Net Core Default encryption methods to store the password. It uses a Key Derivation Function with random salt to produce the hash.The Microsoft.AspNetCore.Identity handles this.
- The FuelQuoteApp_p1/Models Contains all the models and their validations, these are the models which were responsible for capturing the data for the backend.
- The FuelQuoteApp_p1.EntModels Contains the models which will be used for the data exchange between the frontend and Backend.
- The FuelQuoteApp_p1/Controllers has all the controllers for our project.
For creating the database, we have to create a DBContext model (FuelQuoteDBContext.cs in the project). We have to state the DB sets in that model which will create the necessary tables in the database.
Appsettings.json : "ConnectionStrings": { "MyCon": "server=DESKTOP-VE1MV7L;database=FQPDB;Integrated Security=True;" }
Startup.cs:
services.AddDbContext(item=> item.UseSqlServer(Configuration.GetConnectionString("MyCon")).UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking));
Then we have to run the following commands in Package Manager Console (PMC)
- Install-Package Microsoft.EntityFrameworkCore.Tools
- Add-Migration InitialCreate
- Update-Database
This will create a database with name FQPDB in the microsoft sql server management studio.This installs the PMC tools for EF Core. The Add-Migration command scaffolds a migration to create the initial set of tables for the model. The Update-Database command creates the database and applies the new migration to it.
- Apoorva Dhondi - Worked on profile management in the database, modified the controllers and generated code coverage reports.
- Sushma Gangavarapu - worked on the login database and encryptions and worked on adding new Views such as quote confirmation etc.
- Lakshmi Narasimha Sai Narne - Worked on the remaining database operations and changed the controllers in the project and worked on writing Unit test cases with NUnit and Mocked methods.
- ASP.NET CORE
- Entity Framework
- NUnit
- Coverlet (For Code Coverage)
- The FuelQuoteApp_p1.Tests Project contains the Test file which contains Unit Test cases for the AccountController and ClientController files. Only these files contains the runnable code required for the project (In these files we excluded the functions which contains the hard coded and dummy data values).
- We added the project FuelQuoteApp_p1.BusinessLayer, it will be updated with the logics for all the modules in the upcoming assignments.
- The FuelQuoteApp_p1/Models Contains all the models and their validations, these are the models which were responsible for capturing the data for the backend.
- The FuelQuoteApp_p1.EntModels Contains the models which will be used for the data exchange between the frontend and Backend.
- The FuelQuoteApp_p1/Controllers has all the controllers for our project.
- Apoorva Dhondi - Worked on Validations(Account, Client, Quote) for the Backend Models and updated the frontend Models.
- Sushma Gangavarapu - Created all the Models(Account, Client, Quote) for Backend and modified the Views accordingly.
- Lakshmi Narasimha Sai Narne - Modified the Controllers in the project and worked on writing Unit test cases and generated Code Coverage reports.
- Microsoft Visual Studio with .NET CORE 5
- SQL Server Management Studio
- Download the Project
- Change the Connection String in appsettings.json. We have included the login module in our project (just a basic module to run the project)
- In the Visual Community, run the following commands in Nuget Package Manager Console:
- add-migration createDB
- update-databse
- Run the Project through IIS Express.
- The Models folder contains all the classes and the requirements for the attributes in the classes. The controller contains all the routing for the views and Views contain all the cshtml pages.
- We have included some dummy records to display in the Get Quote Price and Quote History web pages.
- _Layout.cshtml in Views/Shared is the layout page which is shared by all the web pages in Views
- Apoorva Dhondi - Worked on creating LoginPage, Get Quote page, and worked on stylings for both the pages and Validations for the fields in both pages.
- Sushma Gangavarapu - Worked on creating Client Profile page, Quote History page and styling changes for both the pages and also worked on Validations for the fields on both pages.
- Lakshmi Narasimha Sai Narne - Worked on creating Home Page, Registration page and validations for the fields in registration page and also worked on Navbar for the website.