Coder Social home page Coder Social logo

patrickgod / blazorecommerce Goto Github PK

View Code? Open in Web Editor NEW
296.0 25.0 156.0 293 KB

Code for the online course "Make an E-Commerce Website with Blazor WebAssembly in .NET 6" on Udemy.

Home Page: https://www.udemy.com/course/blazor-ecommerce/?referralCode=381AC9F708E79D672899

HTML 20.80% C# 74.41% CSS 4.79%

blazorecommerce's People

Contributors

patrickgod avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blazorecommerce's Issues

ADO.NET Entity Data Model for the Products

image
Microsoft Visual Studio Community 2022
Version 17.1.0 Preview 2.0
VisualStudio.17.Preview/17.1.0-pre.2.0+32104.313
Microsoft .NET Framework
Version 4.8.04084

Wanted to add the ADO.NET Entity Data Model for the Products and got the following
Error message????

Thank you
harold ferus jr

Update to .NET 7?

.NET 7 RC2 is out and will have support. Might you create an update to this in .NET 7 RC2?

@patrickgod Bug in StoreCartItems Method in the Server's CartService.cs

Issue:

Assume that a user, let us call it USER_A, has a product P with a quantity x in its stored shoping cart.
Immagine that USER_A logged out from the session and went to the cart page. The current shopping list will be empty as expected.
Now, the user decided to add another product P with quantity z then he rememberd to log in. The current implementation will override the quantity of product P to z quantity.

Suggestion:

I belive that the quantity of product P should be the sum of (z+x). To achive that I implemented the StoredCartItems as below.
Code:

public async Task<ServiceResponse<List<CartProductResponse>>> StoreCartItems(List<CartItem> cartItems)
{
	cartItems.ForEach(cartItem => cartItem.UserId = GetUserId());
	// Get Stored Cart Items for the User
	var cartItemsFromDB = await _context.CartItems
		.Where(ci => ci.UserId == GetUserId())
		.ToListAsync();

	// If the locally stored cartItem is equal to the DB stored items then update quantity
	// otherwise add the cartItem to the DB
	foreach (var cartItem in cartItems)
	{
		var sameItem = cartItemsFromDB.Find(dbItem => dbItem.ProductId == cartItem.ProductId
		&& dbItem.ProductTypeId == cartItem.ProductTypeId);
		if (sameItem != null){
			sameItem.Quantity += cartItem.Quantity;
			// Update Existing item quantity
			_context.CartItems.Update(sameItem);
		}
		else
		{
			// Add the new item to the DB
			_context.CartItems.Add(cartItem);
		}
	}

	await _context.SaveChangesAsync();
	return await GetDbCartProducts();
}

How to check if authToken is not expired?

Hi,

Congratulations, this is an excellent project to learn about the elements of a project.

My question is about the authToken expiration time. Where do you validate that token is not expired?

Thank you.

Update to .NET 8 Auto Mode

I would really like to see this using auto mode in .Net 8, where the Webassembly app is run on the server uusing websockets, then switching to full webassembly when it's downloaded.

I imagine initial performance would be GREAT!

Prerendering .Net8

If we want to upgrade this project to .NET 8 and use RenderMode for enabling the prerendering for SEO, got error because the authentication not worked with prerendering.

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.