I need some advice on best practices when creating an Entity and setting its (what are effectively enums) properties in .NET.
To take a simple example, let's say I have an object called 'Todo', which has three properties:
ID (int)
Text (string)
State (NotStarted, InProgress, Complete)
My Todo object will be stored in a SQL Server database, with the 'Type' property stored as an int. The State property will not have any other information or methods associated with it, it is just to mark the completeness of the Todo instance.
Should I be creating an enum (outside the Todo class) in Todo.cs as follows:
public class Todo
{
public int Id { get; set; }
public string Text { get; set; }
public TodoState State { get; set; }
}
Or should I be creating a TodoState class that has an internal enum and static constructors? Or is there a better completely different way of doing this?
In addition to what you think would be the best way to achieve this in this instance, what are the industry standard way of approaching this kind of problem? Thanks in advance.