You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add SQL Server support and image handling features
Migrated database from SQLite to SQL Server, adding support for binary image storage (`ImageData`) and base64-encoded image serialization (`ImageDataBase64`). Updated `Product` entity with timestamps (`CreatedDate`, `ModifiedDate`) and enhanced `OnModelCreating` for SQL Server-specific configurations.
Introduced new API endpoints for product image retrieval (`/api/Product/{id}/image`), product count, and debug information. Added support for uploading images via `PUT /api/Product/{id}/image`.
Enhanced Blazor frontend with responsive layouts, improved product grid design, and debug tools (`ProductsDebug.razor`). Updated `ProductService` to handle image URLs and API interactions.
Added database setup scripts (`Setup.sql`, `LoadImages.sql`) and a PowerShell script (`LoadImages.ps1`) for image loading. Updated `README.md` with setup instructions, troubleshooting tips, and architecture details.
Enabled CORS for Blazor frontend, configured static file serving, and initialized the database on startup. Improved maintainability, scalability, and user experience.
newProduct{Name="Solar Powered Flashlight",Description="A fantastic product for outdoor enthusiasts",Price=19.99m,ImageUrl="product1.png"},
40
-
newProduct{Name="Hiking Poles",Description="Ideal for camping and hiking trips",Price=24.99m,ImageUrl="product2.png"},
41
-
newProduct{Name="Outdoor Rain Jacket",Description="This product will keep you warm and dry in all weathers",Price=49.99m,ImageUrl="product3.png"},
42
-
newProduct{Name="Survival Kit",Description="A must-have for any outdoor adventurer",Price=99.99m,ImageUrl="product4.png"},
43
-
newProduct{Name="Outdoor Backpack",Description="This backpack is perfect for carrying all your outdoor essentials",Price=39.99m,ImageUrl="product5.png"},
44
-
newProduct{Name="Camping Cookware",Description="This cookware set is ideal for cooking outdoors",Price=29.99m,ImageUrl="product6.png"},
45
-
newProduct{Name="Camping Stove",Description="This stove is perfect for cooking outdoors",Price=49.99m,ImageUrl="product7.png"},
46
-
newProduct{Name="Camping Lantern",Description="This lantern is perfect for lighting up your campsite",Price=19.99m,ImageUrl="product8.png"},
47
-
newProduct{Name="Camping Tent",Description="This tent is perfect for camping trips",Price=99.99m,ImageUrl="product9.png"},
74
+
{
75
+
// Note: ImageUrl is set to null - images will be loaded into ImageData via LoadImages.ps1 script
76
+
// This enables Scenario 2: Database image serving via /api/Product/{id}/image
77
+
newProduct{Name="Solar Powered Flashlight",Description="A fantastic product for outdoor enthusiasts",Price=19.99m,ImageUrl=null,CreatedDate=DateTime.UtcNow,ModifiedDate=DateTime.UtcNow},
78
+
newProduct{Name="Hiking Poles",Description="Ideal for camping and hiking trips",Price=24.99m,ImageUrl=null,CreatedDate=DateTime.UtcNow,ModifiedDate=DateTime.UtcNow},
79
+
newProduct{Name="Outdoor Rain Jacket",Description="This product will keep you warm and dry in all weathers",Price=49.99m,ImageUrl=null,CreatedDate=DateTime.UtcNow,ModifiedDate=DateTime.UtcNow},
80
+
newProduct{Name="Survival Kit",Description="A must-have for any outdoor adventurer",Price=99.99m,ImageUrl=null,CreatedDate=DateTime.UtcNow,ModifiedDate=DateTime.UtcNow},
81
+
newProduct{Name="Outdoor Backpack",Description="This backpack is perfect for carrying all your outdoor essentials",Price=39.99m,ImageUrl=null,CreatedDate=DateTime.UtcNow,ModifiedDate=DateTime.UtcNow},
82
+
newProduct{Name="Camping Cookware",Description="This cookware set is ideal for cooking outdoors",Price=29.99m,ImageUrl=null,CreatedDate=DateTime.UtcNow,ModifiedDate=DateTime.UtcNow},
83
+
newProduct{Name="Camping Stove",Description="This stove is perfect for cooking outdoors",Price=49.99m,ImageUrl=null,CreatedDate=DateTime.UtcNow,ModifiedDate=DateTime.UtcNow},
84
+
newProduct{Name="Camping Lantern",Description="This lantern is perfect for lighting up your campsite",Price=19.99m,ImageUrl=null,CreatedDate=DateTime.UtcNow,ModifiedDate=DateTime.UtcNow},
85
+
newProduct{Name="Camping Tent",Description="This tent is perfect for camping trips",Price=99.99m,ImageUrl=null,CreatedDate=DateTime.UtcNow,ModifiedDate=DateTime.UtcNow}
0 commit comments