
Explore a complete ASP.NET Core e-commerce demo built with Dapper, featuring admin management of categories and products, customer login and cart, checkout, and pending orders with stored procedures.
Set up ecommerce project with dapper by creating database, category and product tables, wiring a dapper context, and exposing a json api to fetch products with categories using stored procedure.
Explore the product controller's index, create/update, and delete actions in a .NET Core MVC with Dapper course, each returning views and noting the category dependency.
Learn to implement and run stored procedures for the category table, including add, delete, update, get all categories, and get category by id.
Build a category service with a model (id, name, display order, created date time) and async CRUD, implemented via Dapper context, stored procedures, and a categories controller.
Create and manage categories with a category controller in dot net core mvc, wiring in a category service and implementing index, create, edit, and delete actions with async calls.
Build the category views for the controller, add index, create, edit, and delete views, configure dependency injection for category service, and validate category model fields like created date time.
Build a product controller by creating a product view model, binding categories with a select list, and handling create update with get product by id via a stored procedure.
Define a utility service interface with save image, edit image, and delete image methods, using container name, file, and db path parameters.
Implement a concrete utility service to save and delete images using web host environment and http context accessor, extracting db paths and saving with a guid-based name.
Continue with the product controller to implement create update, adding new products when id is zero, updating when non-zero, saving images via the utility service, persisting with the product service.
Fetch the product by id, delete its image via the utility service, then execute the stored procedure to delete the product by id, and redirect to the index.
Design a view for the all products page in a .NET Core MVC app, using a data table with create and update actions and toaster and sweet alert notifications.
Explore building a create update view for products in a .NET Core MVC app, using a product VM, image upload, and a post method to handle create and update operations.
Learn to set up the home controller with a product service, fetch all products with categories, and display them in bootstrap cards with links to a details page.
Create users, roles, and user_roles tables with primary keys, unique constraints, and foreign keys to enable a many-to-many user role model; prepare for Dapper in ASP.NET Core.
Learn how to seed a role and a user by creating two stored procedures: sp_add_role and sp_add_user, which insert into roles, users, and user_roles, then execute in ASP.NET Core.
Register a data seeder in the program file by registering the data center as a scoped service and invoking its seed data at startup to populate admin and customer roles.
Add login and register view models under the accounts view model, defining username and password for login, and username, email, password, and confirm password for registration to prepare accounts controller.
Build a register and login service in .NET Core MVC with Dapper, including an application user model, authenticate and register async methods, and an accounts controller for auth flows.
Master register and login action methods in .NET Core MVC with Dapper by wiring accounts controller, register and login view models, and implementing cookie-based authentication with claims.
Build an authentication workflow by wiring an authentication service and a user service with login and register methods, using HttpContextAccessor to check authentication and retrieve the username.
Register authentication handlers in program.cs by adding cookie authentication defaults, including login and logout paths for the accounts controller. Learn to configure sign-in flow, login attempts, and post-authentication redirects.
Implement get user roles asynchronously using the get_user_roles stored procedure for a user id, returning a list of role names and enabling an authorization filter for all roles.
Implement a role based authorization filter by creating a role authorize attribute that implements IAuthorizationFilter and checks user roles, routing unauthenticated users to login and denying access when needed.
Add and implement a get user id method in the user service by extracting the user id from the name identifier claim and storing it during login.
Create a cart table linked to users and products in the ecommerce project, and implement a details action and view to display product details and enable adding items to cart.
Modify the stored procedure to merge product and category data via an inner join and return the category name with product details for get product by ID.
Implement a http post details method to add a product to the cart by product id and user id, and fetch cart items via stored procedure SP get cart items.
Implement a cart service in net core mvc with dapper to fetch cart items via a stored procedure and add items by creating and executing stored procedures, returning cart items.
Add cart item asynchronously by calling the cart service, which uses the stored procedure SP add card item with product id, user id, and count, updating or inserting the cart.
Add a cart item in .net core mvc with dapper, using role-based authorization for customers and admins, wiring the cart service, and enabling login to add items.
Implement a .NET Core MVC cart controller with dapper, injecting card and cart services, enforcing role-based access, and retrieving cart items by user ID via stored procedure and view models.
Display and manage shopping cart items in a .NET Core MVC app using a cart VM and order header, and compute order totals while building a cart index view.
Create a card view component with constructor injection of cart and user services, manage session cart count for authenticated users, and return its view or redirect to login.
Configure session in program.cs by adding session services and setting a 30-minute timeout. Enable the session middleware and secure cookies with http only and essential flags.
Design the cart view component in the shared directory by creating a components/cart folder with a default view to display cart items and support incrementing, decrementing, and deleting items.
Create and execute stored procedures to increment and decrement cart item quantities, delete items, and update or remove cart records by id in the database.
Implement asynchronous methods in the cart service to increment and decrement cart item quantities using stored procedures, via Dapper and a create connection context.
Implement cart management by adding plus, minus, and delete actions to update item quantities via the card service and refresh the session cart after changes.
Implement a logout function in the AccountsController that clears the HTTP context session and redirects to the login page, then signs out and reestablishes authentication with claims identity.
Delete a cart item by id using a stored procedure, wire up the service, controller, and views to remove the item and refresh the session cart, then proceed to payment.
Build a cart summary page in .NET Core MVC with Dapper, using VM.orderHeader to hold name, phone, address, city, state, postal code; populate from user info in the cart controller.
Create the user profiles table with a foreign key to the users table and define its fields. Implement add, update, and get stored procedures to manage and retrieve user profiles.
Create a user profile model and a dapper-based service with async get and create-or-update methods, using stored procedures, plus a controller to manage user profile operations.
Create a user profiles controller and wire in user and user profile services, fetch the current user id, and implement get, create, and update flows with a razor view.
Shows posting a create or update user profile in an mvc app, retrieving the user ID, saving via profile service, and redirecting to index with an update and pay flow.
Build a cart summary by loading user info through the user profile service, aggregating cart items into an order header, and calculating the total for display.
Create a static details class with order status and payment status constants (pending, approved, canceled, in progress, processing, refund), and apply them on the summary page for new orders.
Create and relate order header and order detail tables in an e-commerce database, defining foreign keys and references to order headers and products, and prepare a stored procedure.
Create a table type for order details, insert multiple items with a new order header, and use a stored procedure to add order header and details in ASP.NET Core.
Develop an order service for the order header and order details table in a .NET Core MVC with Dapper project, implementing add order with details async using a table-valued parameter.
Modify the stored procedure to delete cards by user id, return the generated order header id as integer, and render a success page with that order id.
Select a Bootswatch theme, integrate flat.css and layout.css, and implement a header navigation partial to customize the navbar in an ASP.NET Core MVC project.
Update the navigation to include home, categories, products, and orders. Open the code in the browser to verify categories, product, cart, and home; next video covers admin-only authentication for orders.
apply role authorize attributes to protect routes in a .NET Core MVC with dapper project, securing products and category controllers and restricting access to admin and customer roles.
Dapper Fundamentals Tutorials , How Dapper Communicate with database objects. How Dapper Handle Relationships like one to one and one to many and many to many. Complete Example of Ecommerce Project in .NET 8 with Dapper Technique. In project we have Some modules like UI, Product catalogue , cart and Order Details. How Dapper Handle Authentication and Authorization using efficient manner. Dapper communicate with database table create a session. Use Filters to Authorize. In this project we have a Repository pattern with Dependency Injection to handle Dapper Communication. We have a Dashboard for Admin and Customer. Admin Manage. Product Catalogue. Right now payment option is under processing but we will add later using stripe method and razor pay. Dapper Communicate with database table using stored procedure.
- Modules of the Ecommerce Project
Admin Module - CRUD Operation on Product and Category Catalogue , Manage Customer Order
Customer Module - Add Item into Cart and Proceed Order
Dapper Connection - Using one to many and many to many mapping
Dapper Security - Custom User Account with Hased password
Seed User Information using Dapper
Repository Pattern with Dependency Injection.
Dapper Methods which is Used in Project- ExecuteAsync, QueryAsync,QueryFirstOrDefault, Split Tables
Access data from database table via stored procedue.
Filters - Customer Request filter by their roles. In this project , i use custom Authorize Filter for customer request