public List <SelectListItem> GetAllBatchSlItems() { var batches = _trainerManager.GetAllBatch(); var slItems = new List <SelectListItem>(); foreach (var batch in batches) { var sli = new SelectListItem(); sli.Text = batch.No; sli.Value = batch.Id.ToString(); slItems.Add(sli); } return(slItems); }