The code below with the static keyword works fine but I want to make the below property as constant in C#.
The reason for doing so is the consistency through out the project. All the property which value is never going to change is marked as const not the static or static readonly in the existing project.
public class StatusList { public static Dictionary<DownloadStatus, int> DownlodStatusList { get { return new Dictionary<DownloadStatus, int>() { { DownloadStatus.Preview, (int)DownloadStatus.Preview }, { DownloadStatus.Active, (int)DownloadStatus.Active }, { DownloadStatus.Expired, (int)DownloadStatus.Expired }, { DownloadStatus.Inactive, (int)DownloadStatus.Inactive } }; } } }
constvalue must be literalstaticwhich will be same in nature asconstnew ...withconst. That´s it.