You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
365 B
14 lines
365 B
using Microsoft.AspNetCore.Mvc.Rendering;
|
|
using System.Linq;
|
|
|
|
namespace TeacherExt.Controllers
|
|
{
|
|
public static class ArrayExt
|
|
{
|
|
public static SelectList ToSelectList(this string[] array,string selected)
|
|
{
|
|
return new SelectList(array.Select(o=>new SelectListItem { Value=o,Text=o }),"Value","Text",selected);
|
|
}
|
|
}
|
|
}
|