public async Task <IHttpActionResult> GetBid(int id) { Bid objct = await db.Bids.FindAsync(id); if (objct == null) { return(NotFound()); } BidNoR newObject = new BidNoR() { // Bids= objct.Bids, // BankApproval = objct.BankApproval, AmuntOfBid = objct.AmuntOfBid, // AuctionRegistration = objct.AuctionRegistration, // Guarintee = objct.Guarintee, // Auction = objct.Auction, // Property = objct.Property, BidID = objct.BidID, BuyerID = objct.BuyerID, // ConcludedAuctions = objct.ConcludedAuctions, PropertyID = objct.PropertyID, // RegisteredBuyer = objct.RegisteredBuyer, TimeOfbid = objct.TimeOfbid //Seller = objct.Seller // AuctionRegistration = fee.AuctionRegistration }; return(Ok(newObject)); }
// GET: api/Bids public ICollection <BidNoR> GetBids() { List <BidNoR> Lys = new List <BidNoR>(); foreach (Bid objct in db.Bids.Include(b => b.Auction).Include(b => b.RegisteredBuyer)) { BidNoR newObject = new BidNoR() { // Bids= objct.Bids, // BankApproval = objct.BankApproval, AmuntOfBid = objct.AmuntOfBid, // AuctionRegistration = objct.AuctionRegistration, // Guarintee = objct.Guarintee, // Auction = objct.Auction, // Property = objct.Property, BidID = objct.BidID, BuyerID = objct.BuyerID, // ConcludedAuctions = objct.ConcludedAuctions, PropertyID = objct.PropertyID, // RegisteredBuyer = objct.RegisteredBuyer, TimeOfbid = objct.TimeOfbid //Seller = objct.Seller // AuctionRegistration = fee.AuctionRegistration }; Lys.Add(newObject); } return(Lys); }