Conversation
chrisjamiecarter
left a comment
There was a problem hiding this comment.
Hey @Lepros311 👋,
Excellent work on your Ecommerce API project submission 🎉!
I have performed a peer review. Review/ignore any comments as you wish.
🟢 Requirements
⭐ You have fulfilled all of the project requirements!
I will go ahead and mark as approved, keep up the excellent work on the next projects! 😊
Best regards,
@chrisjamiecarter 👍
|
|
||
| public DbSet<LineItem> LineItems { get; set; } | ||
|
|
||
| protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) => optionsBuilder.UseSqlServer(@"Server=(localdb)\mssqllocaldb;Database=EcommerceDb;Trusted_Connection=True;Initial Catalog=EcommerceDb"); |
| using Ecommerce.Api.Repository; | ||
| using Ecommerce.Api.Services; | ||
|
|
||
| var builder = WebApplication.CreateBuilder(args); |
|
|
||
| namespace Ecommerce.Api.Data; | ||
|
|
||
| public class EcommerceDbContext : DbContext |
There was a problem hiding this comment.
🟢 Products, Categories and Sales
|
|
||
| protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) => optionsBuilder.UseSqlServer(@"Server=(localdb)\mssqllocaldb;Database=EcommerceDb;Trusted_Connection=True;Initial Catalog=EcommerceDb"); | ||
|
|
||
| protected override void OnModelCreating(ModelBuilder modelBuilder) |
There was a problem hiding this comment.
🟢 Products and Sales Many-to-Many Relationship
|
|
||
| public string ProductName { get; set; } | ||
|
|
||
| public decimal Price { get; set; } |
There was a problem hiding this comment.
🟢 Products need to have a price
| } | ||
|
|
||
| [HttpGet] | ||
| public async Task<ActionResult<List<ProductDto>>> GetPagedProducts([FromQuery] PaginationParams paginationParams) |
There was a problem hiding this comment.
🟢 GetProducts endpoints need to have pagination capabilities
| } | ||
|
|
||
| [HttpGet] | ||
| public async Task<ActionResult<List<CategoryDto>>> GetPagedSales([FromQuery] PaginationParams paginationParams) |
There was a problem hiding this comment.
🟢 GetSales endpoints need to have pagination capabilities
|
|
||
| public bool IsDeleted { get; set; } = false; | ||
|
|
||
| public override string ToString() => $"{CategoryName}"; |
There was a problem hiding this comment.
🟡 String Interpolation
❓ Any need here? surely this will do:
| public override string ToString() => $"{CategoryName}"; | |
| public override string ToString() => CategoryName; |
| } | ||
| }, | ||
| "AllowedHosts": "*", | ||
| "ConnectionStrings": { "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=EcommerceDb;Trusted_Connection=True;Initial Catalog=shiftsDb" } |
There was a problem hiding this comment.
🟠 Environment Variables
💡 You really need to make your mind up whether you are going to use this appsettings connection string, or the hard coded one you provide to OnConfiguring...
No description provided.