Update DB to PROD; reformat GetAllByProductId method

Switched connection string to use FruitBank_PROD database.
Reformatted GetAllByProductId in OrderDtoDbTable.cs for clarity; no logic changes.
This commit is contained in:
Loretta 2026-01-06 15:15:57 +01:00
parent 610c3963f0
commit ab6fb3ab88
1 changed files with 2 additions and 1 deletions

View File

@ -46,7 +46,8 @@ public class OrderDtoDbTable : MgDtoDbTableBase<OrderDto, Order>
&& o.OrderStatusId != (int)OrderStatus.Cancelled
&& o.GenericAttributes.Any(ga => ga.Key == nameof(OrderDto.DateOfReceipt) && DateTime.Parse(ga.Value) >= fromDate.Date));
public IQueryable<OrderDto> GetAllByProductId(int productId, bool loadRelations = true) => GetAll(loadRelations).Where(o => o.OrderItemDtos.Any(oi => oi.ProductId == productId));
public IQueryable<OrderDto> GetAllByProductId(int productId, bool loadRelations = true)
=> GetAll(loadRelations).Where(o => o.OrderItemDtos.Any(oi => oi.ProductId == productId));
public IQueryable<OrderDto> GetAllByProductIds(IEnumerable<int> productIds, bool loadRelations = true)
=> GetAll(loadRelations).Where(o => o.OrderItemDtos.Any(oi => productIds.Contains(oi.ProductId)));