protected override void LoadOthers(IEnumerable <OrderModel> models) { var ids = models.Select(s => s.Id); var charges = _orderChargeValueSearchRepository.GetChargeValues(UserContext.Current.SubscriberId, ids); models.ToList().ForEach(model => { var cs = charges.FirstOrDefault(s => s.Key == model.Id); model.Charges = cs == null ? new List <OrderChargeValueModel>() : cs.ToList(); }); }
public OrderModel GetOrder(Guid orderId) { var subscriberId = UserContext.Current.SubscriberId; var order = _orderSearchRepository.GetEntity(subscriberId, orderId); var properties = _orderPropertyValueSearchRepository.GetPropertyValues(subscriberId, orderId); var charges = _orderChargeValueSearchRepository.GetChargeValues(subscriberId, orderId); var model = Mapper.Map <OrderModel>(order); model.Properties = properties; model.Charges = charges; return(model); }