public Bill GetBill(Guid bookingId) { using (var context = new BillingContext()) { return(context.Bills.FirstOrDefault(b => b.BookingId == bookingId)); } }
public Bill RemoveBill(Guid billId) { using (var context = new BillingContext()) { var bill = context.Bills.Remove(context.Bills.FirstOrDefault(b => b.Id == billId)); context.SaveChanges(); return(bill); } }
public Bill AddBill(decimal price, string requisites, Guid bookingId) { using (var context = new BillingContext()) { var bill = context.Bills.Add(new Bill() { Price = price, Requisites = requisites, BookingId = bookingId }); context.SaveChanges(); return(bill); } }