
Build a smart e-shop with .NET Core MVC, combining theory and practical coding, including tag helpers, view components, dependency injection, identity, sessions, repository pattern, and entity framework core.
Demonstrate building a .NET Core MVC e-shop: from the home page to product details, cart, login, checkout, and validation using tag helpers and DI.
Create a new esb net core application in Visual Studio 2019 with an empty project, target net core 3.0, enable authentication and authorization, and explore Program.cs and Startup for hosting.
Enable the mvc pattern by adding controllers with views, configure middleware for static files and routing, and map a default controller route with an optional id for database access.
Create mvc models for candy shop: define candy and category classes with properties like candyId, name, price, image URL, isOnSale, and category relationship; implement interfaces and repositories with dependency injection.
Create candy and category repository interfaces for a .net core mvc project, exposing methods to get all candies, candies on sale, and a candy by id.
Implement a category repository class that implements the ICategoryRepository interface and returns a hard-coded list of three categories: hard candy, chocolate candy, and fruit candy.
Add a candy repository that implements the candy interface, seed dummy data with categories, images, stock, and sale status, and register services in startup for the .NET core MVC e-shop.
Register interfaces with their implementing repositories in startup using add scoped, enabling instances for category and candy data access via dependency injection, connecting controllers and views to the data layer.
Learn to add a controller in an MVC app by creating a controllers folder, defining a Candy controller that inherits from controller, and injecting repository interfaces via the constructor.
Create a public action method that returns a view result and passes a list of all candy to the view, with plans to include categories and view models later.
Create a candy list view under views, bind it to the candy model as an enumerable, and display name, price, and category using Razor syntax. Configure routing to candy/list.
Replace view bag with a dedicated view model in a .NET Core MVC app, passing candies and the current category from controller to view for clean rendering with partial views.
Learn how partial views enable code reuse across pages by sharing a layout in the views/shared folder, and configure _viewstart and _viewimports to manage layout and model namespaces.
Create a shared razor layout in the shared folder and use _ViewStart to apply a partial layout across pages, with the layout rendering the body content.
Add directives in the view imports to import the candy shop view models. Use using statements for the candy shop namespaces, then bootstrap the app to improve visuals.
Add bootstrap and jQuery to a .NET Core MVC app using the client side library manager, place them under wwwroot/lib, and wire static files, images, and a site.css for styling.
Load Bootstrap CSS and JS, jQuery, and Google fonts, then apply container, row, and column classes to style the layout, with a 3-column logo and 9-column content split.
Style the candy list view with thumbnails, captions, prices, names, and descriptions rendered from the model in a for each loop. Enable data persistence with entity framework core.
Entity Framework Core is an object-relational mapper that maps domain classes to database tables, enables code-first data access and persistence via a database context, a connection string, and startup registration.
Install entity framework core packages, create a database context class inheriting from DbContext, configure the options, and expose DbSet<Candy> candies and DbSet<Category> categories to manage entities.
Register a database context with Entity Framework Core, configure a default connection string in appsettings.json, and use SQL Server with a trusted connection to connect to the candy shop database.
Modify the candy repository to use Entity Framework Core with a real DbContext, replacing hardcoded data, including categories, and filtering on sale items for the e-shop.
Map the category repository to entity framework core using constructor injection of the Abdi context and return all categories from it. Wire up services in Startup and prepare the database.
Learn to create a database with code first migration in EF Core, generate categories and candies tables with a foreign key, and apply update-database to build the candy shop database.
Seed the database using the on model creating method in the db context, define initial categories and candies with the model builder, and apply migrations to seed and verify data.
Remove squiggly characters from image paths to fix image display, update the seeding script, and ensure the database-driven app shows 15 candies per category with thumbnails.
Explore how MVC routing maps URLs to controller actions, using convention-based patterns, default routes, and optional parameters like id, with constraints to ensure valid requests.
Learn how tag helpers improve navigation in .NET Core MVC, compare them to older helpers, and enable them via view imports or a tag helper directive to create links.
Create a home controller with an index action and default candy route. Add a details action that fetches candy by id, validates, returns not found, and renders details view.
Create a details view for candy items in a .NET Core MVC e-shop, displaying name, full image, price, and description using the candy model and a clickable name.
Add and use built-in tag helpers globally to turn candy names into links to a details page by wiring asp-controller, asp-action, and asp-route-id in the list view.
Add a responsive navigation bar to the shared underscore layout using bootstrap, with tag helpers routing to home index and candy list actions. It adapts to smaller screens.
Explore reuse with partial views to render candy lists and special deals, using an underscore-named partial, a model, and the partial tag helper for multiple views.
Create and reuse a candy card partial to render a list in a .NET Core MVC app, using the partial tag helper on the list and home page.
Create a home page with a new home controller and index action that uses a partial view and passes candy on sale via a home view model to the view.
Create a home view for the index action, add a shared carousel partial and candy cards, and render candy on sale from the home view model.
Implement shopping cart using sessions in a dotnet core mvc app, wiring DI and middleware, enabling sessions, and adding the cart model, view, migration, and navigation.
Define a shopping cart item model with id, shopping cart id, candy, and amount, and add it to the database context with a migration.
Create a shopping cart model and inject the database context to access data. Use the user session to assign a unique cart id and provide a static get cart method.
Create an add to cart method that accepts a candy and quantity, validates ids, creates or updates a shopping cart item, and saves changes to the IDB context.
Learn to implement a public remove-from-cart method that decrements item quantities. It validates cart and item existence, saves changes, and returns the updated amount.
Get all items from the cart by returning a list of shopping cart items, filtering by cart id, and including related candy data via Entity Framework Core.
Implement a clear cart method that fetches items for this shopping cart from the db context, removes them with remove range, and saves changes to empty the cart.
Calculate shopping cart total by summing price times quantity for items with the cart id, returning a decimal; register the cart as a scoped service and enable sessions before routing.
Create a .Net Core Mvc shopping cart controller by injecting the candy repository and shopping cart, implement index with a shopping cart view model, and plan an add-items action.
Add to shopping cart action for a .NET Core MVC e-shop: accept a candy id, retrieve the matching candy, add it to the cart, and redirect to the cart index.
Implement a remove from shopping cart action that finds the selected candy by id, removes it (not the amount), and redirects to the index view to display the updated cart.
Build a shopping cart view in a .NET Core MVC app that lists cart items in a table, showing amount, candy, price, subtotal, and total with currency formatting.
Add an add-to-cart button on the candy card and details page, wired with tag helpers to pass the candy id to the shopping cart add action, updating items and totals.
Learn to use view components in ASP.NET Core MVC, with logic and own models. Create a shopping cart summary and a navigation component to show item counts on every page.
Build a shopping cart view component in a .NET Core MVC app by injecting the cart, loading items and total, and returning a view model to render the cart.
Create a shopping cart view component in ASP.NET Core MVC by structuring shared components, wiring a shopping cart view model, rendering a default Razor view, and injecting it into layout.
Create a category menu view component in a .net core mvc e-shop that uses a dropdown to list categories from the category repository and filter candy by category.
Update candy list action to filter by the category using a route parameter, fetch candies from the repository, and pass a view model with the current category.
Create a custom email tag helper in ASP.NET Core MVC by extending tag helper base class and overriding process to render a mailto anchor with an address and link text.
Create an order form by binding a new order model with tag helpers, add basic input validation, and define order details to support a one-to-many relationship, totals, and order date.
Create IOrderRepository and a concrete order repository that builds an order and its details from the shopping cart, computes the total, saves changes, and registers in startup.
Add a checkout form and view in an ASP.NET core mvc app by creating an order controller, wiring the repository and cart, and binding inputs to the order model.
Bind the order via model binding on form post, validate the cart, create the order, clear the cart, and redirect to checkout complete while preserving input on errors.
Create a checkout complete action that returns a view displaying a 'thanks for your order' message via the view bag. Add validation to prevent blank submissions.
Validate data on the server side using data annotations in .NET Core MVC, applying required, string length, and display attributes, plus bind never for calculated fields.
Implement input validation in the checkout view with a top validation summary and per-field messages using tag helpers; enforce character limits and address format before placing orders.
Add authentication and authorization with asp.net core identity to verify users and restrict actions. Configure identity with the built-in context, scaffolding support, and options like password strength and external providers.
Install and configure ASP.NET Core identity with Entity Framework Core packages, replace the db context with identity context, create identity tables via migrations, and enable authentication in startup after routing.
Enable authentication in the dotnet core mvc e-shop by scaffolding with a razor class library, leveraging built-in identity, including user manager and sign-in manager for login and registration.
Scaffold login, logout, and register with identity using entity framework stores, configure razor pages, and integrate a login partial into the layout to enable authentication and later authorization.
Enable authorization on the order controller to require users to be authenticated, optionally by role, and configure authentication in startup to protect order placement.
Welcome to Creating ASP .Net Core 3.0 MVC Database Driven Web Applications
As the title of the course suggests, we will be creating a web driven application using ASP .Net Core 3.0 with the help of .Net Core and Entity Framework.
Step by step, we will set up a small e-store with a back end database. For the next several hours, we will dedicate our time to interfaces, dependency injection, table relationships, .Net Core Services, Repository Pattern, MVC, ViewComponents, TagHelpers, Sessions, Authentication and Authorization, Entity Framework Core, and of course, C# language. But don't let any of that scare you. Quite the opposite.
Get excited to learn a lot of new material and dive into the new world of .Net Core 3.0. The course makes the learning easy with the mix of introduction of new material, and practical coding! Every step is explained every time.
Remember, this is a course, and a practical tutorial. There are lot of courses that will show you the way into one topic and then quickly move on to another topic. This is not one of those courses! My goal is to lead you step by step, all the way, through the new territory inside .Net Core 3.0 and introduce you to new concepts and topics and help you learn them. And equally important is to then help you understand and retain what you learned. If you learn best by combining explanation and coding along then this course is definitely for you!
So is this course for you? What skills should you have before taking it? If you are a programmer with decent understanding of OOP principles and C#, than you have the all the skills needed to benefit from this course. There are no prerequisites for .net core, or entity framework or how to create and MVC app. Since you are interested in this course, I assume you heard of these things and perhaps played around a little too. That's all that is needed to take this course.
Well, let's code!