namespace SilverlightSqlSpatial.Web
{
	using System.Data.Services;

    /// <summary>
    /// MapService Service Class Handler
    /// </summary>
    [System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)]
    public partial class MapService : DataService<DataManager>
    {
		/// <summary>
        /// Initializes the service.
        /// </summary>
        /// <param name="config">The config.</param>
        public static void InitializeService(DataServiceConfiguration config)
        {
					config.SetEntitySetAccessRule("Counties", EntitySetRights.AllRead);
					config.SetEntitySetAccessRule("Locations", EntitySetRights.AllRead);
		            // TODO: set service behavior configuration options
            // Examples:
            // config.DataServiceBehavior.AcceptCountRequests = true;
            // config.DataServiceBehavior.AcceptProjectionRequests = true;
            config.DataServiceBehavior.MaxProtocolVersion = System.Data.Services.Common.DataServiceProtocolVersion.V2;
        }
        
        /// <summary>
        /// Called when an exception is thrown while processing a request.
        /// </summary>
        /// <param name="args">Exception arguments.</param>
        protected override void HandleException(HandleExceptionArgs args)
        {
            base.HandleException(args);
        }
    }
}