This method is not the best, but the circular link problem continued, so at the last minute he hit it. For some reason, even though I exit the original link order on a detailed object, I still have another connection to the session. Should I use get instead? Or is there a better way to say evict ALL orders with ID = x?
public DetailDTO SaveNewDetailToOrder(DetailDTO detailDTO) { var detailReturn = new DetailDTO(); try { var order = LoadOrderById(detailDTO.OrderId); var previousStatus = issue.CurrentDetailStatus; if (previousStatus != null && detailDTO.Status.Id != previousStatus.Id) { var detail = Mapper.Map<DetailDTO, Detail>(detailDTO); _orderRepository.EvictOrder(detail.DetailOrder); order.Details.Add(detailDTO); order.IsEscalated = false; order.DormantDate = detailDTO.CreatedTime; var orderReturn = SaveOrder(order);
nhibernate
Seth
source share