using System;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.ServiceModel.Web;

// WebInvoke is not needed in order for this to work and is there to show how you can easily
// change the response format 

namespace AjaxWebServicesDemo
{
    [ServiceContract]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class SimpleService
    {
        [OperationContract]
        [WebInvoke(ResponseFormat=WebMessageFormat.Json)]
        public Customer SaveCustomer(Customer customer, Customer customer2)
        {
            customer.CustomerId = Guid.NewGuid().ToString();
            return customer;
        }
    }
}
