public async Task <Models.Bid> ShowLastBidForProductAsync(Guid productId) { Task <Models.Bid> taskInvoke = Task <Models.Bid> .Factory.StartNew(() => { _bidRepository.Configure(); var listBid = _bidRepository.GetBidsAsync().Result.Where(b => b.ProductId == productId); if (listBid.IsNullOrEmpty()) { return(null); } var listBidDTO = listBid.Select(b => Mapper.Map <Models.Bid>(b)); return(listBidDTO.MaxBy(b => b.Price)); }); return(await taskInvoke); }