Skip to content

VIbanichuka/SimpleCalculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 

Repository files navigation

A Simple Calculator application with ASP.NET Core

This SimpleCalculator application features:

Design Pattern

  • Dependency Injection Design Pattern
  • The MVC (Model-View-Controller) architectural Design Pattern

For information about MVC pattern and DI pattern

The application is separated into 3 layers:

The SimpleCalculator.Web and SimpleCalculator.Console use the same business logic Calculations

The web application showcases:

  • ASP.NET core MVC
  • ASP.NET core WEB API
  • Using EntityFramework core and Microsoft SQL Server
  • AutoMapper for mapping one object to another.
  • LINQ
  • Client-side requests paging using JavaScript Ajax Call
  • Unit tests for the Services using xUnit and Moq

Prerequisites

.NET

  1. Install .NET 6

Database

  1. Install the dotnet-ef tool
  2. Install the Microsoft SQL Server Management Studio

Running the console application using Visual Studio Code

  • Visual Studio Code - Open the SimpleCalculator.Console terminal windows and then run the command:

    dotnet watch run 
    

    This will run the console application and display the console UI for user interaction:

Screenshot 2023-03-05 145251

Running the web application using Visual Studio Code

  • Visual Studio Code - Open the SimpleCalculator.Web terminal windows and then run the command:

    dotnet watch run 
    

    This will run the web application. Navigate the web application - Home - Privacy - Results

Screenshot 2023-03-05 151255

  • The webpage Home displays the calculator's UI for calculation operations and some filtered data from Microsoft SQL server as shown above:
    • ASP.NET Core MVC
    • LINQ retrieves data from the data source as well as order and filter the data

Screenshot 2023-03-05 154443

  • The webpage Results displays filtered calculation results from Microsoft SQL server and a pagination panel as shown above:
    • ASP.NET Core Web API and JavaScript Ajax Call retrieves data and display paging
    • LINQ retrieves data from the data source and filters the data that displays on the webpage

Optional

Using the API standalone

The SimpleCalculator Web API controller can run standalone as well. You can run it and make requests to various endpoints using any client of your choice:

Screenshot 2023-03-05 175617

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •