C# Class PhotoSharingApp.AppService.ServiceCore.ServiceFault

Helper class for instantiating errors returned. from the service.
Datei anzeigen Open project: Microsoft/Appsample-Photosharing Class Usage Examples

Public Methods

Method Description
BadRequest ( string source, ushort code, string description ) : HttpResponseException

Creates a fault exception with the HTTP status code 400.

Forbidden ( string source, ushort code, string description ) : HttpResponseException

Creates a fault exception with the HTTP status code 403.

InternalServerError ( string source, ushort code, string description ) : HttpResponseException

Creates a fault exception with the HTTP status code 500.

NotFound ( string source, ushort code, string description ) : HttpResponseException

Creates a fault exception with the HTTP status code 404.

ServiceUnavailable ( string source, ushort code, string description ) : HttpResponseException

Creates a fault exception with the HTTP status code 503.

Unauthorized ( string source, ushort code, string description ) : HttpResponseException

Creates a fault exception with the HTTP status code 401.

Private Methods

Method Description
Create ( HttpStatusCode statusCode, ServiceFaultContract fault ) : HttpResponseException
Create ( HttpStatusCode statusCode, string source, ushort code, string description ) : HttpResponseException

Method Details

BadRequest() public static method

Creates a fault exception with the HTTP status code 400.
public static BadRequest ( string source, ushort code, string description ) : HttpResponseException
source string The source of the fault.
code ushort The code of the fault.
description string A human-readable description of what went wrong.
return HttpResponseException

Forbidden() public static method

Creates a fault exception with the HTTP status code 403.
public static Forbidden ( string source, ushort code, string description ) : HttpResponseException
source string The source of the fault.
code ushort The code of the fault.
description string A human-readable description of what went wrong.
return HttpResponseException

InternalServerError() public static method

Creates a fault exception with the HTTP status code 500.
public static InternalServerError ( string source, ushort code, string description ) : HttpResponseException
source string The source of the fault.
code ushort The code of the fault.
description string A human-readable description of what went wrong.
return HttpResponseException

NotFound() public static method

Creates a fault exception with the HTTP status code 404.
public static NotFound ( string source, ushort code, string description ) : HttpResponseException
source string The source of the fault.
code ushort The code of the fault.
description string A human-readable description of what went wrong.
return HttpResponseException

ServiceUnavailable() public static method

Creates a fault exception with the HTTP status code 503.
public static ServiceUnavailable ( string source, ushort code, string description ) : HttpResponseException
source string The source of the fault.
code ushort The code of the fault.
description string A human-readable description of what went wrong.
return HttpResponseException

Unauthorized() public static method

Creates a fault exception with the HTTP status code 401.
public static Unauthorized ( string source, ushort code, string description ) : HttpResponseException
source string The source of the fault.
code ushort The code of the fault.
description string A human-readable description of what went wrong.
return HttpResponseException