My Goal: Create a C# class for predefined errors that have both an ID and a Message. Here was what I tried:
public class MyError
{
public static readonly
I would create a class that
That would give you the following code:
public sealed class MyError
{
public static readonly MyError OK = new MyError(0, "OK");
public static readonly MyError Bad = new MyError(1, "Bad Stuff");
private MyError(int id, string message)
{
this.ID = id;
this.Message = message;
}
public int ID { get; private set; }
public string Message { get; private set; }
}