0
有類Task.cs保持任務優先級(ASP.NET MVC)
public class Task
{
[Required]
public int Id { get; set; }
[Required]
public string Title { get; set; }
public string Description { get; set; }
public int Priority { get; set; }
[Required]
public string DateCreation { get; set; }
public string DateTarget { get; set; }
public bool IsActive { get; set; }
public bool IsDeleted { get; set; }
}
及其財產Priority
可以有4個不同的值,最好的方法:0 - 低,1 - 正常, 2 - 高,3 - 極端。 保留這些值的最佳方法是什麼?我應該創建class Priority
,還是隻在我的數據庫中創建表Priority
,並設置這些值或使用List
也許?
這是我第一次嘗試創建Asp.Net MVC應用程序,所以我不確定哪種方法更好。
如果值是不可能改變的,可考慮將它的'enum' –
你是問,你應該保持工作的選擇,使他們可以在視圖例如被渲染落下? – StuartLC
你可以看看'enum' https://msdn.microsoft.com/en-us/library/sbbt4032.aspx – Amitd