Table of Contents

Class Error

Namespace
GastroSky.Models
Assembly
GastroSky.Models.dll

Error structure to return in response bodies.

public sealed class Error
Inheritance
Error
Inherited Members

Constructors

Error()

Parameterless ctor.

public Error()

Error(int, string)

Creates an Error using a specific error code and title.

public Error(int code, string title)

Parameters

code int

Internal API error code.

title string

Server-side error title (in English).

Properties

Code

The error code (clients can switch on this number to for example pick a corresponding translated error title).

public int Code { get; set; }

Property Value

int

Title

Server-side error title to the client.

public string? Title { get; set; }

Property Value

string

Operators

implicit operator Error((int, string))

Allow direct conversions of tuples into Error instances.

public static implicit operator Error((int, string) errorContext)

Parameters

errorContext (int, string)

Key-value pair tuple of the Code and Title.

Returns

Error