public BidResponseDto(Bid bid) { this.Id = bid.Id; this.ProfileType = ProfileType.Caterer; this.Description = bid.Description; this.Price = bid.Price; this.WeddingId = bid.WeddingId; }
public BidDto(Bid bid) { this.Id = bid.Id; this.Price = bid.Price; this.Description = bid.Description; this.WeddingId = bid.WeddingId; this.BidderId = bid.BidderId; }
public void OnBidAdded(Bid bid) { throw new NotImplementedException(); }
public IHttpActionResult TryToAddBid(BidRequestDto dto) { var bidder = this.uow.Bidders.GetAll().Where(x => x.Email.ToLower() == Username.ToLower()).Single(); var bid = new Bid() { BidderId = bidder.Id, Description = dto.Description, WeddingId = dto.WeddingId, Price = dto.Price }; this.repository.Add(bid); this.uow.SaveChanges(); var response = new BidResponseDto(bid); var context = GlobalHost.ConnectionManager.GetHubContext<BidHub>(); context.Clients.All.onBiddAdded(new { Data = response }); return Ok(response); }