public async Task <IHttpActionResult> GetAdminFee(int id) { AdminFee adminFee = await db.AdminFees.FindAsync(id); if (adminFee == null) { return(NotFound()); } AdminFeeNoR newAdd = new AdminFeeNoR() { Amount = adminFee.Amount, DateOfPayment = adminFee.DateOfPayment, PaymentID = adminFee.PaymentID, ProofOfPaymentPath = adminFee.ProofOfPaymentPath, // AuctionRegistration = fee.AuctionRegistration }; return(Ok(adminFee)); }
// GET: api/AdminFees public ICollection <AdminFeeNoR> GetAdminFees() { List <AdminFeeNoR> Lys = new List <AdminFeeNoR>(); foreach (AdminFee fee in db.AdminFees.Include(a => a.AuctionRegistration)) { AdminFeeNoR newAdd = new AdminFeeNoR() { Amount = fee.Amount, DateOfPayment = fee.DateOfPayment, PaymentID = fee.PaymentID, ProofOfPaymentPath = fee.ProofOfPaymentPath, // AuctionRegistration = fee.AuctionRegistration }; Lys.Add(newAdd); } return(Lys); }