GithubHelp home page GithubHelp logo

pankajkadam333 / asp-.net-core-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gsa/asp-.net-core-template

0.0 0.0 0.0 55.25 MB

ASP .NET Core Project Template

JavaScript 0.41% C# 2.45% CSS 35.28% HTML 1.90% SCSS 59.95%

asp-.net-core-template's Introduction

ASP .NET Core Project Template

ASP .NET Core Project Template for GSA FM IT team. Every one should be able to use this templae to build a ASP .NET Core web app with PostgreSQL database and beautifully looking U.S. Web Deisgn Standard UI.

Key Functions

  1. Landing page design with U.S. Web Deisgn System 2.
  2. Cross-platform.
  3. Sing-in pgae exmaple.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Installing

  1. Download and copy to \My Documents\Visual Studio 2017\Templates\ProjectTemplates folder.

Using the Template for a New Project

  1. Launch Visual Studio 2019 and create a new project. Use the "ASP.NET Core Web Application" template (C#). Use a unique name for the new project.
  2. In the "Create a new ASP.NET Core web application" window, select ".NET Core" and "ASP.NET Core 3.1" in the dropdown menus. Choose the "Empty" project type and Check the "Configure for HTTPS" box. Click "Create".
  3. Once the project has been created, close Visual Studio.
  4. Clone this repository to a new folder.
  5. Remove all of the files and folders from within your project's web root. This includes the following:
    • bin/
    • obj/
    • Properties/
    • appsettings.Development.json
    • appsettings.json
    • Program.cs
    • Startup.cs
  6. Copy all files and folders from this repository's 2nd ASP Core MVC Template subdirectory and paste them into the same location within your own project. You're replacing all of the files you removed in the previous step.
  7. Rename the ASP Core MVC Template.csproj file to your own project's name. Edit it with an app like Notepad and make the following changes:
    • Replace the <RootNamespace> value with your project's namespace.
  8. Rename the ASP Core MVC Template.csproj.user file to your own project's name.
  9. Rename the ASP_CORE_MVC_Template_appsettings_Example.json file to <YOURPROJECT>_appsettings.json.
  10. Copy <YOURPROJECT>_appsettings.json to the folder you assigned to the APPSETTINGS_DIRECTORY environment variable (as described earlier in this readme).
  11. Edit AssemblyInfo.cs as follows:
    • Replace the RootNamespace value with your project's namespace.
  12. Edit Program.cs as follows:
    • Change namespace ASP_Core_MVC_Template to namespace <YOURPROJECTNAMESPACE>
    • Change config.AddJsonFile("ASP_Core_MVC_Template_appsettings.json") to config.AddJsonFile("<YOURPROJECT>_appsettings.json")
  13. Edit Startup.cs as follows:
    • Change namespace ASP_Core_MVC_Template to namespace <YOURPROJECTNAMESPACE>
    • Change options.Cookie.Name = ".Core-Web-Template.Session"; to options.Cookie.Name = ".<YOURPROJECT>.Session";
    • Change loggerFactory.AddFile(logDirectory + "/Core-Web-Template-{Date}.log"); to loggerFactory.AddFile(logDirectory + "/<YOURPROJECT>-{Date}.log");
    • Change app.UsePathBase("/core-web"); to app.UsePathBase("/<yourproject>"); (make sure you preserve all lowercase for this change!)
  14. Remove all bin\Debug\netcoreapp3.1\ASP Core MVC Template.* files.
  15. Edit Controllers\HomeControler.cs as follows:
    • Change using ASP_Core_MVC_Template.Models; to using <YOURPROJECT>.Models;
    • Change namespace ASP_Core_MVC_Template.Controllers to namespace <YOURPROJECTNAMESPACE>.Controllers
    • If using AppStatus functionality from CAAM, change _configService.GetAppClosed("CORE_TEMPLATE"); to _configService.GetAppClosed("<YOURPROJECT>");
    • If using AppStatus functionality from CAAM, change _configService.GetAppWarning("CORE_TEMPLATE"); to _configService.GetAppWarning("<YOURPROJECT>");
    • If using roles from CAAM, edit the [Authorize(Roles = "COREADMIN,COREUSER")] line to use roles that are applicable to your project.
  16. Edit Controllers\LoginControler.cs as follows:
    • Change namespace ASP_Core_MVC_Template.Controllers to namespace <YOURPROJECTNAMESPACE>.Controllers
    • If using roles from CAAM, edit _dataAPIService.GetCAAMRoles("Core Template" to _dataAPIService.GetCAAMRoles("<YOURPROJECT>"
  17. Edit Models\ErrorViewModel.cs as follows:
    • Change namespace ASP_Core_MVC_Template.Models to namespace <YOURPROJECTNAMESPACE>.Models
  18. If using roles from CAAM, edit Views\Home\LoggedIn.cshtml as follows:
    • Change Context.User.IsInRole("COREADMIN") to use a role applicable to your project.
  19. Edit Views\Home\Warning.cshtml as follows:
    • Change <title>Warning - CAAM Web Template</title> to <title>Warning - <YOURPROJECT></title>
  20. Edit Views\Shared\_Layout.cshtml as follows:
    • Change @ViewData["Title"] - Core Web Template to @ViewData["Title"] - <YOURPROJECT>
    • Change aria-label="Home">Core Web Template to aria-label="Home"><YOURPROJECT>
  21. Edit Views\_ViewImports.cshtml as follows:
    • Change both instances of @using ASP_Core_MVC_Template to @using <YOURPROJECT>

asp-.net-core-template's People

Contributors

lcy-m avatar leocyang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.