First push#98
Conversation
chrisjamiecarter
left a comment
There was a problem hiding this comment.
Hey @DSills735 👋,
❓ Is this project submission ready?
I can see no files to review.
Thanks 👍,
@chrisjamiecarter
|
Not really sure how that happened. It should be good to go now. Im still not finished with the frontend. |
chrisjamiecarter
left a comment
There was a problem hiding this comment.
Hey @DSills735 👋,
I have not reviewed yet as just opened the solution and there are already issues.
🔧 Next Steps
- Please fix any 🔴 items, as they block approval.
- Commit and push your changes, then leave me a comment when done.
- Feel free to reach out if you have any questions or want to discuss further 🆘.
Thanks,
@chrisjamiecarter 👍
| @@ -0,0 +1,4 @@ | |||
| <Solution> | |||
| <Project Path="Sills.GolfShop.eCommerce/Sills.GolfShop.eCommerceAPI.csproj" /> | |||
|
Thats what I get for making last second changes without testing them... silly me. @chrisjamiecarter It builds now. |
chrisjamiecarter
left a comment
There was a problem hiding this comment.
Hey @DSills735 👋,
Excellent work on your Ecommerce API project submission 🎉!
I have performed a peer review against the C# Academy requirements. Review/ignore any comments as you wish.
What You Did Well 🟢
- ✅ Solid project structure with proper separation between API and Frontend projects
- ✅ Good use of Dependency Injection throughout (Program.cs services)
- ✅ Entity Framework Core implementation with proper DbContext
- ✅ Many-to-many relationship correctly implemented with ProductSales junction table
- ✅ Soft deletes implemented with DeletedAt field on Product and Categories
- ✅ Price field excluded from ProductUpdateDto (requirement met)
Areas for Improvement 🟠
- blocking async calls (.Result, .Wait()) - Should use await throughout to prevent thread blocking
- pagination bugs - GetProducts and GetSales both calculate pagination but return unpaged results
🔧 Next Steps
- Please fix any 🔴 items, as they block approval.
- Commit and push your changes, then leave me a comment when done.
- Feel free to reach out if you have any questions or want to discuss further 🆘.
Thanks,
@chrisjamiecarter 👍
| { | ||
| return await _context.Sales.ToListAsync(); | ||
| } | ||
| public async Task<Sales> GetSaleByIdAsync(int id) |
There was a problem hiding this comment.
| public async Task<Sales> GetSaleByIdAsync(int id) | |
| public async Task<Sale?> GetSaleByIdAsync(int id) |
| public async Task AddProductToSaleAsync(int saleId, int productId) | ||
| { | ||
| var sale = await _context.Sales.FindAsync(saleId); | ||
| var product = await _context.Products.FindAsync(productId); | ||
| if (sale == null || product == null) | ||
| { | ||
| return; | ||
| } | ||
| var productSale = new ProductSales | ||
| { | ||
| Sale = sale, | ||
| Product = product | ||
| }; | ||
| _context.ProductSales.Add(productSale); | ||
| await _context.SaveChangesAsync(); | ||
| } |
There was a problem hiding this comment.
🟡 No Confirmation of Result
💡 How do you know whether this succeeded or not? Maybe return a bool?
| public async Task AddProductToSaleAsync(int saleId, int productId) | |
| { | |
| var sale = await _context.Sales.FindAsync(saleId); | |
| var product = await _context.Products.FindAsync(productId); | |
| if (sale == null || product == null) | |
| { | |
| return; | |
| } | |
| var productSale = new ProductSales | |
| { | |
| Sale = sale, | |
| Product = product | |
| }; | |
| _context.ProductSales.Add(productSale); | |
| await _context.SaveChangesAsync(); | |
| } | |
| public async Task<bool> AddProductToSaleAsync(int saleId, int productId) | |
| { | |
| var sale = await _context.Sales.FindAsync(saleId); | |
| var product = await _context.Products.FindAsync(productId); | |
| if (sale == null || product == null) | |
| { | |
| return false; | |
| } | |
| var productSale = new ProductSales | |
| { | |
| Sale = sale, | |
| Product = product | |
| }; | |
| _context.ProductSales.Add(productSale); | |
| return await _context.SaveChangesAsync() > 0; | |
| } |
…n to proper address.
|
Hello again @chrisjamiecarter . I have updated the project, and believe my revisions are complete. I went ahead and removed the frontend as I am not finished with it yet. |
chrisjamiecarter
left a comment
There was a problem hiding this comment.
Hey @DSills735 👋 ,
Code updates look good. For some reason I cannot perform a review...
Please ensure you go through all my previous comments and take my advise onboard!
See you in the next one. I will approve this.
Thanks,
@chrisjamiecarter 👍

Ive finished the base with 2/3 challenges. As you can tell, I am working on the frontend. I just wanted to submit the api to make sure I was on the right track.