In meinem Code ich habe dies:Muss ich Cast und Enum und wie mache ich das?
var wordForm = new WordForm()
{
WordId = word.WordId,
Definition = webWordForm.definition,
SourceId = webWordForm.sourceId,
StatusId = EStatus.Download,
PosId = WordToPosId(webWordForm.partOfSpeech)
};
ich erklärte die Enum:
public enum EStatus {
NotSet = 0,
New = 1,
Download = 2,
Edited = 3
}
und die StatusID:
public int StatusId { get; set; } // StatusId
Muss ich dies in einen int werfen müssen, und wenn Also, wie mache ich das?
(int) EStatus.Download oder Convert.ToInt32 (EStatus.Download) –
Was ist der Typ von WordForm.StatusId? – fahadash
Mögliches Duplikat von [Get int value from enum] (http://stackoverflow.com/questions/943398/get-int-value-from-enum) –