fix:Product

This commit is contained in:
2025-11-28 16:23:07 +04:00
parent 574f498975
commit 5680ae8265
4 changed files with 10 additions and 1 deletions

View File

@ -70,7 +70,7 @@ public class ProductsApplication(IProductRepository productRepository)
price: updateProductView.Price, price: updateProductView.Price,
quantity: updateProductView.Quantity); quantity: updateProductView.Quantity);
if (update.IsActive == true) if (updateProductView.IsActive == true)
{ {
update.Activate(); update.Activate();
} }

View File

@ -1,5 +1,6 @@
using Domain.Aggregates.Stores; using Domain.Aggregates.Stores;
using Domain.Aggregates.Users; using Domain.Aggregates.Users;
using Domain.Aggregates.Products;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
namespace Persistence; namespace Persistence;
@ -14,5 +15,6 @@ public class DatabaseContext: DbContext
public DbSet<User> Users { get; set; } public DbSet<User> Users { get; set; }
public DbSet<Store> Stores { get; set; } public DbSet<Store> Stores { get; set; }
public DbSet<Product> Products { get; set; }
} }

View File

@ -8,4 +8,5 @@
<h2 class="text-start">Pages</h2> <h2 class="text-start">Pages</h2>
<a class="btn btn-secondary my-2" asp-page="Panel/Users/Index">[ Users ]</a> <a class="btn btn-secondary my-2" asp-page="Panel/Users/Index">[ Users ]</a>
<a class="btn btn-secondary my-2" asp-page="Panel/Stores/Index">[ Stores ]</a> <a class="btn btn-secondary my-2" asp-page="Panel/Stores/Index">[ Stores ]</a>
<a class="btn btn-secondary my-2" asp-page="Panel/Products/Index">[ Products ]</a>
</div> </div>

View File

@ -1,9 +1,12 @@
using Application.Aggregates.Products;
using Application.Aggregates.Stores; using Application.Aggregates.Stores;
using Application.Aggregates.Users; using Application.Aggregates.Users;
using Domain.Aggregates.Products.Data;
using Domain.Aggregates.Stores.Data; using Domain.Aggregates.Stores.Data;
using Domain.Aggregates.Users.Data; using Domain.Aggregates.Users.Data;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Persistence; using Persistence;
using Persistence.Repositories.Aggregates.Products;
using Persistence.Repositories.Aggregates.Stores; using Persistence.Repositories.Aggregates.Stores;
using Persistence.Repositories.Aggregates.Users; using Persistence.Repositories.Aggregates.Users;
using Server.Infrastructure.Extensions.ServiceCollections; using Server.Infrastructure.Extensions.ServiceCollections;
@ -34,6 +37,9 @@ public class Program
builder.Services.AddScoped<IStoreRepository, StoreRepository>(); builder.Services.AddScoped<IStoreRepository, StoreRepository>();
builder.Services.AddScoped<StoresApplication>(); builder.Services.AddScoped<StoresApplication>();
builder.Services.AddScoped<IProductRepository, ProductRepository>();
builder.Services.AddScoped<ProductsApplication>();
var app = builder.Build(); var app = builder.Build();
if (!app.Environment.IsDevelopment()) if (!app.Environment.IsDevelopment())