Пример #1
0
 /// <summary>
 ///     全部猪下拉列表
 /// </summary>
 /// <returns></returns>
 public IEnumerable<SelectListItem> GetPigList()
 {
     var pigService = new PigService();
     IEnumerable<SelectListItem> pigSelect = pigService.FindAll().Select(pigtypeItem => new SelectListItem
                                                                                            {
                                                                                                Text =
                                                                                                    pigtypeItem.
                                                                                                    Number,
                                                                                                Value =
                                                                                                    pigtypeItem.
                                                                                                        Id +
                                                                                                    string.Empty,
                                                                                            })
                                                       .OrderBy(m => m.Text);
     return pigSelect;
 }