All Projects → aspnetrun → run-aspnetcore-basics_retired

aspnetrun / run-aspnetcore-basics_retired

Licence: MIT license
One Solution - One Project for web application development with Asp.Net Core & EF.Core. Only one web application project which used aspnetcore components; razor pages, middlewares, dependency injection, configuration, logging. To create websites with minimum implementation of asp.net core based on HTML5, CSS, and JavaScript. You can use this boi…

Programming Languages

C#
18002 projects
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to run-aspnetcore-basics retired

Run Aspnetcore
A starter kit for your next ASP.NET Core web application. Boilerplate for ASP.NET Core reference application, demonstrating a layered application architecture with applying Clean Architecture and DDD best practices. Download 100+ page eBook PDF from here ->
Stars: ✭ 227 (+1413.33%)
Mutual labels:  aspnetcore, clean-code, starter-kit, entity-framework-core, aspnet-core
Equinoxproject
Full ASP.NET Core 5 application with DDD, CQRS and Event Sourcing concepts
Stars: ✭ 5,120 (+34033.33%)
Mutual labels:  visual-studio, aspnetcore, clean-code, aspnet-core, ef-core
sass-starter-pack
Sass starter files using Gulp v4.0.0 🔥
Stars: ✭ 34 (+126.67%)
Mutual labels:  starterkit, starter-template, starter-kit, starter-project
materializecss starter
A Starter Boilerplate for Materializecss, ionicons, font-awesome and Animatecss
Stars: ✭ 58 (+286.67%)
Mutual labels:  starter-template, starter-kit, starter-project
run-aspnetcore-blazor
New .Net Core 3.0 Asp.Net Blazor Components SPA Web Application
Stars: ✭ 22 (+46.67%)
Mutual labels:  aspnetcore, aspnet-core, aspnet-core-template
Znetcs.aspnetcore.logging.entityframeworkcore
This is Entity Framework Core logger and logger provider. A small package to allow store logs in any data store using Entity Framework Core.
Stars: ✭ 24 (+60%)
Mutual labels:  aspnetcore, entity-framework-core, aspnet-core
Run Aspnetcore Realworld
E-Commerce real world example of run-aspnetcore ASP.NET Core web application. Implemented e-commerce domain with clean architecture for ASP.NET Core reference application, demonstrating a layered application architecture with DDD best practices. Download 100+ page eBook PDF from here ->
Stars: ✭ 208 (+1286.67%)
Mutual labels:  aspnetcore, entity-framework-core, aspnet-core
Architecture
.NET 6, ASP.NET Core 6, Entity Framework Core 6, C# 10, Angular 13, Clean Code, SOLID, DDD.
Stars: ✭ 2,285 (+15133.33%)
Mutual labels:  aspnetcore, clean-code, aspnet-core
emplea do
Open source tech jobs portal. Made with .Net Core
Stars: ✭ 75 (+400%)
Mutual labels:  visual-studio, entity-framework-core, aspnet-core
botfuel-sample-starter
Starter bot using Botfuel Dialog
Stars: ✭ 24 (+60%)
Mutual labels:  starter-template, starter-kit, starter-project
nodejs-hackathon-boilerplate-starter-kit
Just a Hackaton/Startup Full-stack node.js starter
Stars: ✭ 37 (+146.67%)
Mutual labels:  starter-template, starter-kit, starter-project
SampleProject
A starter project for Sample Project in Objective C. Objective C version of https://github.com/xeieshan/SwiftySampleProject
Stars: ✭ 31 (+106.67%)
Mutual labels:  starter-template, starter-kit, starter-project
enlite-starter
Enlite Starter - React Dashboard Starter Template with Firebase Auth
Stars: ✭ 28 (+86.67%)
Mutual labels:  starter-template, starter-kit, starter-project
Dntidentity
A highly customized sample of the ASP.NET Core Identity
Stars: ✭ 145 (+866.67%)
Mutual labels:  aspnetcore, entity-framework-core, aspnet-core
Northwindtraders
Northwind Traders is a sample application built using ASP.NET Core and Entity Framework Core.
Stars: ✭ 4,628 (+30753.33%)
Mutual labels:  entity-framework-core, aspnet-core, code-first
Angularwebpackvisualstudio
Template for ASP.NET Core, Angular with Webpack and Visual Studio
Stars: ✭ 497 (+3213.33%)
Mutual labels:  visual-studio, aspnetcore, aspnet-core
MinimalApi
ASP.NET Core 7.0 - Minimal API Example - Todo API implementation using ASP.NET Core Minimal API, Entity Framework Core, Token authentication, Versioning, Unit Testing, Integration Testing and Open API.
Stars: ✭ 156 (+940%)
Mutual labels:  aspnetcore, entity-framework-core, aspnet-core
laravel-startkit
Laravel Admin Dashboard, Admin Template with Frontend Template, for scalable Laravel projects. It is to save your time when You start with new scalable Laravel projects with many features Bootstrap, cooreui, infyom admin Generator, roles and permissions, translatable models, spatie media and much more
Stars: ✭ 55 (+266.67%)
Mutual labels:  starter-template, starter-kit, starter-project
saas-react-starter-kit-boilerplate
SaaStr is a React SaaS boilerplate to kickstart your new SaaS adventure as fast as possible. Built on top of Adonis JS for the BackEnd and React Starter Kit for the Front-End
Stars: ✭ 100 (+566.67%)
Mutual labels:  starter-template, starter-kit
nest-typescript-starter
Nest framework TypeScript starter (node.js)
Stars: ✭ 35 (+133.33%)
Mutual labels:  starter-kit, starter-project

What is AspnetRun ?

A starter kit for your next ASP.NET Core web application. Boilerplate for ASP.NET Core reference application with Entity Framework Core, demonstrating a layered application architecture with DDD best practices. Implements NLayer Hexagonal architecture (Core, Application, Infrastructure and Presentation Layers) and Domain Driven Design (Entities, Repositories, Domain/Application Services, DTO's...) and aimed to be a Clean Architecture, with applying SOLID principles in order to use for a project template. Also implements best practices like loosely-coupled, dependency-inverted architecture and using design patterns such as Dependency Injection, logging, validation, exception handling, localization and so on.

You can check full repository documentations and step by step development of 100+ page e-book PDF from here - https://aspnetrun.azurewebsites.net/Discover. Also detail introduction of book and project structure exists on medium aspnetrun page. You can follow aspnetrun repositories for building step by step asp.net core web development skills.

AspnetRun Repositories

Here you can find all of the aspnetrun repositories from easy to difficult, Also this list can be track a learning path of asp.net core respectively;

  • run-aspnetcore-basic - intended to building fastest ASP.NET Core Default Web Application template. This solution only one solution one project for idea generation with Asp.Net Core.
  • run-aspnetcore - intended to building Multi-Page Web Applications(MPA) using ASP.NET Core & EF.Core in Clean Architecture with default aspnet core server-side rendering approach.
  • run-aspnetcore-angular - intended to building Single-Page Web Applications(SPA) using ASP.NET Core & EF.Core, Web API Project and Angular for frontend framework.

And there are crucial repositories which are implemented base repository and applying real-world examples with developing new enterprice features for example Identity, Paging, Localization etc..

  • run-aspnetcore-basic-realworld - implemented this repository and build sample of eCommerce reference application on Default ASP.NET Core in a one solution one project for fastest idea implementations.
  • run-aspnetcore-realworld - implemented run-aspnetcore repository and build sample of eCommerce reference application on Multi-Page Web Applications(MPA) using ASP.NET Core Razor Pages templates.
  • run-aspnetcore-angular-realworld - implemented run-angular repository and build sample of eCommerce reference application on Single Page Web Application(SPA) architecture using ASP.NET Core + Angular.

These repositories are updated regularly. We are following Microsoft Web Technologies very closely so we will update all these repositories accordingly with Microsoft Web Application stacks.

run-aspnetcore-basic

Here is CRUD operations of aspnetrun-core-basic template project;

Recordit GIF

AspnetRunBasic has only one solution and into this solution only one web application project with Asp.Net Core & EF.Core which used aspnetcore components; razor pages, middlewares, dependency injection, configuration, logging. To create websites with minimum implementation of asp.net core based on HTML5, CSS, and JavaScript. You can use this boilerplate for fast implementation, minimum development, bootstrap your idea, create Minimum Viable Product (MVP), idea validation, startup development implementation for a limited time and limited resources with using latest asp.net core and entity framework core.

Give a Star!

If you liked the project or if AspnetRun helped you, please give a star. And also please fork this repository and send us pull-requests. If you find any problem please open issue.

Getting Started

Use these instructions to get the project up and running.

Prerequisites

You will need the following tools:

Installing

Follow these steps to get your development environment set up:

  1. Clone the repository
  2. At the root directory, restore required packages by running:
dotnet restore
  1. Next, build the solution by running:
dotnet build
  1. Next, within the AspnetRun.Web directory, launch the back end by running:
dotnet run
  1. Launch http://localhost:5400/ in your browser to view the Web UI.

If you have Visual Studio after cloning Open solution with your IDE, AspnetRun.Web should be the start-up project. Directly run this project on Visual Studio with F5 or Ctrl+F5. You will see index page of project, you can navigate product and category pages and you can perform crud operations on your browser.

Usage

After cloning or downloading the sample you should be able to run it using an In Memory database immediately. The default configuration of Entity Framework Database is "InMemoryDatabase". If you wish to use the project with a persistent database, you will need to run its Entity Framework Core migrations before you will be able to run the app, and update the ConfigureDatabases method in Startup.cs (see below).

public void ConfigureDatabases(IServiceCollection services)
{
            //// use in-memory database
            //services.AddDbContext<AspnetRunContext>(c =>
            //    c.UseInMemoryDatabase("AspnetRunConnection"));

            // add real database dependecy
            services.AddDbContext<AspnetRunContext>(c =>
                c.UseSqlServer(Configuration.GetConnectionString("AspnetRunConnection")));  
}
  1. Ensure your connection strings in appsettings.json point to a local SQL Server instance.

  2. Open a command prompt in the Web folder and execute the following commands:

dotnet restore
dotnet ef database update -c AspnetRunContext

Or you can direct call ef commands from Visual Studio Package Manager Console. Open Package Manager Console, set default project to AspnetRun.Infrastructure and run below command;

update-database

These commands will create aspnetrun database which include Product and Category table. You can see from AspnetRunContext.cs.

  1. Run the application. The first time you run the application, it will seed aspnetrun sql server database with a few data such that you should see products and categories.

If you modify-change or add new some of entities to Core project, you should run ef migrate commands in order to update your database as the same way but below commands;

add-migration YourCustomEntityChanges
update-database

Structure of Project

run-aspnetcore-basic is a general purpose to implement the Default Web Application template of .Net with one solution one project for fastest idea implementations to building modern web applications with latest ASP.NET Core & EF Core technologies.

Repository include folders for group implementations;

  • Data
    • AspnetRunContext
    • AspnetRunContextSeed
  • Entities
    • Product
    • Category
  • Migrations
    • Generated by scaffolding from ef.core
  • Pages
    • Default Razor Web Application Template of Asp.Net Core
  • Repositories
    • IProductRepository
    • ProductRepository
  • wwwroot
  • Startup.cs
  • Program.cs

Data Folder

Includes Entity Framework Core Context and tables in this folder. When new entity created, it should add to context and configure in context. The Infrastructure project depends on Microsoft.EntityFrameworkCore.SqlServer and EF.Core related nuget packages, you can check nuget packages of Infrastructure layer. If you want to change your data access layer, it can easily be replaced with a lighter-weight ORM like Dapper.

Migrations

EF add-migration classes.

Repository

EF Repository implementation. This class responsible to create queries, includes, where conditions etc..

Entities Folder

Includes Entity Framework Core Entities which creates sql table with Entity Framework Core Code First Aproach. Some Aggregate folders holds entity and aggregates. You can see example of code-first Entity definition as below;

public class Product
    {
        public int Id { get; set; }

        [Required, StringLength(80)]
        public string Name { get; set; }

        [Required, StringLength(255)]
        public string Description { get; set; }

        public int UnitPrice { get; set; }        

        public int CategoryId { get; set; }
        public Category Category { get; set; }
    }

Repository Folder

Implementation of Core interfaces in this project with Entity Framework Core and other dependencies. Most of your application's dependence on external resources should be implemented in classes defined in the Infrastructure project. These classes must implement the interfaces defined in Core. If you have a very large project with many dependencies, it may make sense to have more than one Infrastructure project (eg Infrastructure.Data), but in most projects one Infrastructure project that contains folders works well. This could be includes, for example, e-mail providers, file access, web api clients, etc. For now this repository only dependend sample data access and basic domain actions, by this way there will be no direct links to your Core or UI projects.

public interface IProductRepository
    {
        Task<IEnumerable<Product>> GetProductListAsync();
        Task<Product> GetProductByIdAsync(int id);
        Task<IEnumerable<Product>> GetProductByNameAsync(string name);
        Task<IEnumerable<Product>> GetProductByCategoryAsync(int categoryId);
        Task<Product> AddAsync(Product product);
        Task UpdateAsync(Product product);
        Task DeleteAsync(Product product);
        Task<IEnumerable<Category>> GetCategories();
    }

Also implementation located same places in order to choose different implementation at runtime when DI bootstrapped.

 public class ProductRepository : IProductRepository
    {
        protected readonly AspnetRunContext _dbContext;

        public ProductRepository(AspnetRunContext dbContext)
        {
            _dbContext = dbContext ?? throw new ArgumentNullException(nameof(dbContext));
        }

        public async Task<IEnumerable<Product>> GetProductListAsync()
        {
            return await _dbContext.Products.ToListAsync();
        }

        public async Task<Product> GetProductByIdAsync(int id)
        {
            return await _dbContext.Products
                .Include(p => p.Category)
                .FirstOrDefaultAsync(p => p.Id == id);
        }

Pages Folder

Development of UI Logic with implementation. Interfaces drives business requirements and implementations in this layer. The application's main starting point is the ASP.NET Core web project. This is a classical console application, with a public static void Main method in Program.cs. It currently uses the default ASP.NET Core project template which based on Razor Pages templates. This includes appsettings.json file plus environment variables in order to stored configuration parameters, and is configured in Startup.cs.

Used Components

  • Asp.Net Core
  • Entity Framework Core
  • Razor Pages
    • Scaffolding Razor
    • Tag Helpers
    • Bindings
    • Model Validations
    • Navigation - Page Routes
    • User Interfaces
    • Partial Views
    • View Components
    • Razor Sections
    • Dynamic Layout
  • Middlewares
  • Logging
  • Configuration
  • Dependency Injection

***Most of these features implemented on real-world repository of this repos.Check for real-world examples.

wwwroot Folder

The wwwroot folder in the ASP.NET Core project is treated as a web root folder. Static files can be stored in any folder under the web root and accessed with a relative path to that root.

In the standard ASP.NET application, static files can be served from the root folder of an application or any other folder under it. This has been changed in ASP.NET Core. Now, only those files that are in the web root - wwwroot folder can be served over an http request. All other files are blocked and cannot be served by default.

Program.cs

ASP.NET Core web application is actually a console project which starts executing from the entry point public static void Main() in Program class where we can create a host for the web application.

Startup.cs

ASP.NET Core application must include Startup class. It is like Global.asax in the traditional .NET application. As the name suggests, it is executed first when the application starts.

Technologies

  • .NET Core 3.0
  • ASP.NET Core 3.0
  • Entity Framework Core 3.0
  • .NET Core Native DI
  • Razor Pages
  • AutoMapper

Main Objects

  • Asp.Net Core
  • Entity Framework Core
  • Razor Pages
  • Repository Design Pattern
  • Multiple Page Web Application (MPA)
  • Monolitic Deployment Architecture
  • SOLID and Clean Code

Disclaimer

  • This repository is not intended to be a definitive solution.
  • This repository not implemented a lot of 3rd party packages, we are try to avoid the over engineering when building on best practices.
  • Beware to use in production way.

Contributing

Please read Contributing.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Next Releases and RoapMap

For information on upcoming features and fixes, take a look at the product roadmap.

Deployment - AspnetRun Online

This project is deployed on Azure. See the project running on Azure in here.

Pull-Request

Please fork this repository, and send me your findings with pull-requests. This is open-source repository so open to contributions.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].