using Distribution.Data; using Microsoft.EntityFrameworkCore; namespace Distribution.Features.Warehouse; public class WarehouseRepository(AppDBContext context) : IWarehouseRepository { public async Task GetByIdAsync(Guid id) => await context.Warehouses.FindAsync(id); public async Task> GetAllAsync() => await context.Warehouses.ToListAsync(); public async Task AddAsync(Models.Warehouse entity) => await context.Warehouses.AddAsync(entity); public void Update(Models.Warehouse entity) => context.Warehouses.Update(entity); public void Remove(Models.Warehouse entity) { entity.IsActive = false; context.Warehouses.Update(entity); } }