// GET: api/Invoice/5 public Invoice Get(string id) { var task = new LoadInvoiceTask { Status = InvoiceStatus.Posted, Id = id, }.ExecuteMe(); return task.Invoice; }
// GET: api/PrintInvoice/5 public bool Get(string id) { try { var invoice = new LoadInvoiceTask { Id = id, Status = InvoiceStatus.Posted }.ExecuteMe().Invoice; new ReceiptPrinter().printReceipt(invoice); return true; } catch (Exception ex) { Console.WriteLine(ex); } return false; }