private void ProcessWithContext(IServerDataServiceContext context) { if (context == null) { throw new ArgumentNullException("context", "The ServerDataServiceContext cannot be null."); } try { if (this.ServiceObjectiveName != null) { // Retrieve the service objective with the specified name this.WriteObject(context.GetServiceObjective(this.ServiceObjectiveName)); } else if (this.ServiceObjective != null) { // Retrieve the latest service objective with the specified service objective this.WriteObject(context.GetServiceObjective(this.ServiceObjective)); } else { // No name specified, retrieve all service objectives in the server this.WriteObject(context.GetServiceObjectives(), true); } } catch (Exception ex) { SqlDatabaseExceptionHandler.WriteErrorDetails( this, context.ClientRequestId, ex); } }
private void ProcessWithContext(IServerDataServiceContext context) { try { if (this.ServiceObjectiveName != null) { // Retrieve the service objective with the specified name this.WriteObject(context.GetServiceObjective(this.ServiceObjectiveName)); } else if (this.ServiceObjective != null) { // Retrieve the latest service objective with the specified service objective this.WriteObject(context.GetServiceObjective(this.ServiceObjective)); } else { // No name specified, retrieve all service objectives in the server this.WriteObject(context.GetServiceObjectives(), true); } } catch (Exception ex) { SqlDatabaseExceptionHandler.WriteErrorDetails( this, context.ClientRequestId, ex); } }