/// <summary>
        /// Creates the or update environment endpoint.
        /// </summary>
        /// <param name="endpoint">The endpoint.</param>
        /// <returns>System.Nullable&lt;Guid&gt;.</returns>
        public Guid? CreateOrUpdateEnvironmentEndpoint(EnvironmentEndpoint endpoint)
        {
            try
            {
                endpoint.CheckNullObject("endpoint");

                using (var controller = new EnvironmentEndpointDataAccessController())
                {
                    return controller.CreateOrUpdateEnvironmentEndpoint(endpoint, ContextHelper.GetCurrentOperatorKey());
                }
            }
            catch (Exception ex)
            {
                throw ex.Handle( endpoint);
            }
        }
        public JsonResult CreateOrUpdateEnvironmentEndpoint(EnvironmentEndpoint endpoint)
        {
            object returnedObject = null;
            BaseException exception = null;

            try
            {
                endpoint.CheckNullObject("endpoint");
                returnedObject = service.CreateOrUpdateEnvironmentEndpoint(endpoint);
            }
            catch (Exception ex)
            {
                exception = ex.Handle(endpoint);
            }

            ApiHandlerBase.PackageResponse(this.Response, returnedObject, exception);
            return null;
        }