static void Main(string[] args) { var unitOfWork = new UnitOfWorkSqlServer(); var invoiceService = new InvoiceService(unitOfWork); //var result = invoiceService.get(2); var result2 = invoiceService.get(1); }
static void Main(string[] args) { var unitOfWork = new UnitOfWorkSqlServer(); var invoiceService = new InvoiceService(unitOfWork); var result = invoiceService.GetAll(); //var invoice = new Invoice //{ // ClientId = 1, // Detail = new List<InvoiceDetail> // { // new InvoiceDetail { // ProductId = 1, // Quantity = 5, // Price = 1500 // }, // new InvoiceDetail { // ProductId = 8, // Quantity = 15, // Price = 125 // } // } //}; //invoiceService.Create(invoice); //invoiceService.Create(invoice); //var invoice = new Invoice //{ // Id = 33, // ClientId = 1, // Detail = new List<InvoiceDetail> // { // new InvoiceDetail { // ProductId = 1, // Quantity = 5, // Price = 1500 // }, // new InvoiceDetail { // ProductId = 8, // Quantity = 30, // Price = 125 // } // } //}; //invoiceService.Update(invoice); //invoiceService.Delete(33); Console.Read(); }
static void Main(string[] args) { //TestService.TestConecction(); //List<Invoice> result = null; //InvoiceService servicio = new InvoiceService(); //result = servicio.GetAll(); //Invoice result = null; //result = servicio.Get(1); UnitOfWorkSqlServer unitOfWork = new UnitOfWorkSqlServer(); InvoiceService servicio = new InvoiceService(unitOfWork); var result = servicio.GetAll(); /* * //Invoice result = new Invoice(); * //result = servicio.Get(2); * //result = servicio.Get(1); * * * Invoice invoice = null; * InvoiceDetail detail = null; * List<InvoiceDetail> details = null; * details = new List<InvoiceDetail>(); * invoice = new Invoice(); * invoice.ClientId = 1; * * detail = new InvoiceDetail(); * detail.ProductId = 1; * detail.Quantity = 5; * detail.Price = 1500; * details.Add(detail); * * detail = new InvoiceDetail(); * detail.ProductId = 6 ; * detail.Quantity = 15; * detail.Price = 125; * details.Add(detail); * * invoice.Detail = details; * servicio.Create(invoice); */ /* * Invoice invoice = null; * InvoiceDetail detail = null; * List<InvoiceDetail> details = null; * details = new List<InvoiceDetail>(); * invoice = new Invoice(); * invoice.Id = 4; * invoice.ClienteId = 1; * * detail = new InvoiceDetail(); * detail.ProductId = 1; * detail.Quantity = 5; * detail.Price = 1500; * details.Add(detail); * * detail = new InvoiceDetail(); * detail.ProductId = 6; * detail.Quantity = 30; * detail.Price = 125; * details.Add(detail); * * invoice.Detail = details; * servicio.Update(invoice); */ /* * Invoice invoice = null; * invoice = new Invoice(); * invoice.Id = 4; * * servicio.Delete(invoice.Id); */ Console.Read(); }