using System;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;

namespace Hierarchy_WCFService.Web
{
	[ServiceContract(Namespace = "")]
	[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
	public class Service1
	{
		[OperationContract]
		public void DoWork()
		{
			// Add your operation implementation here
			return;
		}

		[OperationContract]
		public IEnumerable<Customer> CustomerList()
		{
			var entities = new NorthwindEntities();
			var customers = entities.Customers.OrderBy(c => c.CustomerID).ToList();
			customers.ForEach(c => c.Orders.Load());
			return customers;
		}

		[OperationContract]
		public IEnumerable<Order> OrderList()
		{
			var entities = new NorthwindEntities();
			return entities.Orders.OrderBy(o => o.OrderID);
		}
		
	}

}
