Skip to content

Introductory, Intermediate, and Advanced .NET Core Application Examples

License

Notifications You must be signed in to change notification settings

KI7MT/dotnet-core-examples

Repository files navigation

.NET Core Examples

Overview

The dotnet-core-examples repository contains samples that you can use to test various aspects of NET Core | ASP Net Core. Each section (folder) contains one or more applications that should run on any number of operating systems, each having their own Makefile to facilitate: clean, pack, install and uninstall. Most applications can run with a simple command: dotnet run. All the samples have been tested as .Net Global Tools.

The code for each application is Verbose, meaning, shortcuts and advanced concatenations have been kept to a minimum to allow for easier readability. Code comments are also brief, but should suffice for most readers.

The majority of the programs are a single file (Program.cs), easy to use, and can be compiled on any operating system capable of running .Net Core SDK.

All of the examples are layed out in sections (Folder Hierarchy). While the Database, WebMVC, and WebAPI sections are not listed as Advanced, the examples represent many challenging aspects of OOP including Dependency Injection, Models, Controllers, Views, and Database Integration.

Usability

At the time of this writing, all example applications were tested on:

System Requirements

  • Supported Operating Systems: Windows, Linux, MacOS
  • Net Core SDK v8.0
  • VS Code Editor is optional but preferred
  • Dual Core CPU Minimum
  • At Least 1GB RAM
  • 1 to 2 GB of Free disk space (if running all apps, less if not)

NOTE: All tools in this repository have been updated with Makefiles that support installing each application as a .Net Global Tool. This allows for global access to the application from anywhere within the user space. File install locations are as follows:

# Windows
C:\Users\%username%\.dotnet\tools

# Linux | MacOS
/home/$USER/.dotnet/tools

Installation Using Makefiles

Each application has its own Makefile with the commands to build, install, uninstall and run the application except where noted. For Windows, the file name is make.cmd. For Linux, the file name is Makefile without extension. In both cases, the invocation command is the same: make <target>.

# Install: In the directory you want to test, type the following:

# Windows
.\make.cmd clean
.\make.cmd pack
.\make.cmd install

# Linux | MacOSX
make
make install

# After install, type the name of the package you installed to execute it.
# Example: To start LBService, type:

LBService

# Upon successful installation, the appropriate application name will be
# displayed with instructions to run it.


# Uninstall: Windows
.\make.cmd uninstall
.\make.cmd clean

# Uninstall: Linux MacOS
make uninstall
make clean

Introductory Logic, Conditions, Loops

Basic Functions employ things such as Arrays, for-loops, while-loops, and if-else statements. All functions are contained within the standard (Program.cs) file. Typically, no other classes are involved apart basic from using statements.

Application Type Description
ComputeArray Array Compute average using an array.
SimpleArray Array Sum 10 entries from user
TargetValue Array Find target value in array
DoubleTriangle for-loop Print a diamond using loops
RightTriangle for-loop Print Right-Triangle using loops
RocketLaunch for-loop Simple count-down counter
SingleTree for-loop Prints a tree using loops
StackDifferent for-loop Stack Different Numbers Across
StackSame for-loop Stack Same Numbers Across
BasicMath if-else Sum, Difference, Quotient, Product, and Average
CorrectChange if-else Use Modulus to calculate correct change
EndsWell if-else Determine the suffix, for a given integer (1-100)
EndsWellExtend if-else Determine the suffix, for a given integer (1-1000)
FeetToYards if-else User Input feet => convert to yards
GradeDetermination if-else Determine letter grade from three input values
LeaguesToNm if-else User Input Leagues => convert to Nautical Miles
MiddleValue if-else Determine the middle value of three integers
MilesPerTank if-else Calculate Miles per Tank of Fuel
NetPayCalc if-else Calculate Net Pay by taking out fixed tax rates
PerfectFit if-else Determine various apsects of Squares and Rectangles
PositiveDifference if-else Determine the Absolute Value (Positive Difference)
SaintIves if-else Simple compounding math statements
SmallestOfFive if-else Determine the smallest of five numbers
AccountBalancer while-loops While loop Account Balancer
AverageNumbers while-loops Average a series of Even and Odd numbers
Cubed while-loops calculate cubed values
Happy while-loops While (true) loop
HighLowRedux while-loops Simple High-Low Game
IncrementBy while-loops Loop that increments by x
LargestNumber while-loops Loop entry, print largest number
PaymentPlan while-loops Loop payment plan comparison, no user input
PowerOff while-loops Loop that calculates powers of 10 for x < <= 10

Intermediate Structures, Methods and Functions

Intermediate employs things such as structures, and methods outside of the main method or (Program.cs) file.

Application Type Description
AreaOfCircle methods Use methods to calc the Area of a Circle
AreaOfTriangle methods Use methods to calc the Area of a Triangle
CalculatePay methods Use methods to calculate Gross Pay
InchesToCentimeters methods Use methods to Convert In. to Cn.
VolumeOfCylinder methods Use methods to calc the Volume of a Cylinder
JobListing struct Use struct to generate job postings
MSLListing struct Use struct to add to listings array and MLS IDs
RandGen struct Advanced Password generator with user input options

Advanced Structures Methods and Classes

Advanced applications are a combination of both Basic and Intermediate functions. They may also use instantiation of classes, interfaces, abstracts, or more advanced Object Oriented Programming (OOP) techniques.

Application Type Description
EmployeeCommissionV1 various Calculate commission for one or more employee's
EmployeeCommissionV2 various Uses: Struct, Array of Struct, if-else, loops and methods
TikTakToe various Game: uses 2D Arrays, if-else, loops, methods, and colors

Redis Leaderboard Stable For Testing Purposes

This application is functional for it's intended purpose, e.g. Testing. However, it should not be considered production worthy.

Application Database DB Setup Status Description
RedisLeaderboard Redis See Docs Stable Ham Radio Contest Leaderboard Example

WSL Neo4J Stable For Testing Purposes

This application is functional for it's intended purpose, e.g. Testing. However, none should not be considered production worthy.

Application Database DB Setup Status Description
WslNeo4J Neo4J TDB Devel Movie DB queries using Console App and Neo4j

About

Introductory, Intermediate, and Advanced .NET Core Application Examples

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published