0% found this document useful (0 votes)
94 views

Setup ASP - Net Project Tutorial by Faiz

This document outlines 11 steps to set up an ASP.NET project with MVC, authentication, and services: 1) Create a new project, 2) Choose templates and authentication, 3) Add core and infrastructure projects, 4) Add dependencies, 5) Add folders, 6) Install extensions, 7) Add core files, 8) Create the database, 9) Add services, 10) Modify the AccountController, and 11) Add themes. The steps configure the project structure, dependencies, authentication, and services using code examples and links provided.

Uploaded by

Faiz Infy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views

Setup ASP - Net Project Tutorial by Faiz

This document outlines 11 steps to set up an ASP.NET project with MVC, authentication, and services: 1) Create a new project, 2) Choose templates and authentication, 3) Add core and infrastructure projects, 4) Add dependencies, 5) Add folders, 6) Install extensions, 7) Add core files, 8) Create the database, 9) Add services, 10) Modify the AccountController, and 11) Add themes. The steps configure the project structure, dependencies, authentication, and services using code examples and links provided.

Uploaded by

Faiz Infy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

SETUP ASP.

NET PROJECT TUTORIAL

STEPS 1 – CREATE NEW PROJECT


STEP 2 - CHOOSE MVC, WEB API, AUTHENTICATION: INDIVIDUAL USER ACCOUNTS
STEP 3 – ADD 2 NEW PROJECT TO SOLUTION (CORE AND INFRASTRUCTURE)
STEP 4 – BUILD DEPENDENCIES

BUILD DEPENDENCIES
PROJECT REFERENCE
STEP 5 – ADD THESE FOLLOWING FOLDERS TO PROJECT
STEP 6 – INSTALL EXTENSION TO THE PROJECT

Install Ninject (Services), Hangfire (Background Job) to Normal Project

Optional:

1. ExcelDataReader – Read Excel


2. SignalR – Real Time Notification
STEP 7 – ADD FILES

1. Core:

Domain folder

i. <Any Name>Role.vb - https://pastebin.com/dWQDsLgV


ii. <Any Name>UserRole.vb - https://pastebin.com/rhie51Ct
iii. User.vb - https://pastebin.com/qbXXfrXi
iv. ? Company.vb - https://pastebin.com/cZ69UfmR
v. ? AuditLog.vb - https://pastebin.com/CV66sJQj

Misc folder

i. Result.vb - https://pastebin.com/bbD5f6gA
ii. Precision.vb - https://pastebin.com/XUBYZ7YA

Services folder

iii. IDataContext.vb - https://pastebin.com/y7PX87G8

2. Infrastructure:

Migrations folder

i. Configuration.vb - https://pastebin.com/62bnPFD2

EntityFramework folder

ii. EFDbContext.vb - https://pastebin.com/Pt26Zekr

3. Nomal:

App_Start folder

You may delete NinjectWeb.cs & NinjectWebCommon.cs

i. NinjectWebCommon.vb - https://pastebin.com/QyKrdLua
ii. ? Startup.Auth.vb - https://pastebin.com/bJxj7KkT
STEP 8 – CREATE DATABASE

Add-migration <name for first migration>

Update-database

You will be able to see your newly created Database in SQL Management Studio
STEP 9 – ADD SERVICES

1. Core
a. Services folder
i. IUserService.vb - https://pastebin.com/CF0exSJj
ii. IUserSession.vb - https://pastebin.com/EMRjzfjz
2. Normal
a. Services folder
i. HttpUserSession.vb - https://pastebin.com/3tkEUhx3
ii. UserService.vb - https://pastebin.com/7SMfn9h2

Add services to NinjectWebCommon > RegisterServices (Do this everytime adding new service)

kernel.Bind(Of IUserSession)().To(Of HttpUserSession)()


kernel.Bind(Of IDataContext)().To(Of EFDbContext)().InRequestScope
kernel.Bind(Of IUserService)().To(Of UserService)()
STEP 10 – MODIFY ACCOUNTCONTROLLER

Refer this to login using services that we created - https://pastebin.com/5edgXuz3

1. Constructor to call service


2. Register
3. Login
4. Log Off
STEP 11 – ADDING THEMES

Copy theme folder to Content/themes/metronics for example

Folder Views > Shared > Theme Name > _filename.vbhtml

1. _index.vbhtml
2. _login.vbhtml
3. _alert.vbhtml (Toastr Notifcation example) - https://pastebin.com/MbDxt6pJ

Make sure change ViewStart layout to new theme layout

You might also like