public Order AddOrder() { var service = new OrderServiceClient(new InstanceContext(this)); var order = new Order() { Customer = new Customer() { CompanyName = "Test", ContactName = "Contact", CustomerID = new Random().Next(1, 99999).ToString(), ContactTitle = "Title" }, Employee = new Employee() { FirstName = "FirstName", LastName = "EmpLastName" }, Shipper = new Shipper() { CompanyName = "Test Shipper", Phone = "123-456" }, ShipAddress = "Address", ShipCity = "City", ShipCountry = "Country" }; var productService = new ProductServiceClient(); var products = productService.GetAllProducts(); Order_Detail[] details = { new Order_Detail() { Discount = 0, Quantity = 5, UnitPrice = 10, ProductID = products[0].ProductID }, new Order_Detail() { Discount = 0, Quantity = 1, UnitPrice = 100, ProductID = products[1].ProductID }, }; order.Order_Details = details; return(service.Add(order)); }