public PrepodSelectLists(Prepod prepod) { Positions = Helper.GetPositions(); Ranks = Helper.GetRanks(); Degrees = Helper.GetDegrees(); if (prepod != null) { selectedRank = Ranks.FirstOrDefault(k => k.Value == (int)prepod.Rank); selectedDegree = Degrees.FirstOrDefault(k => k.Value == (int)prepod.Degree); selectedPosition = Positions.FirstOrDefault(k => k.Value == (int)prepod.Position); } }