ドロップダウンリストにバインドする部門の配列を取得するために、次のメソッドを実装しました
public object[] GetDepartmentOptions()
{
var departments = from p in context.per_Departments
where p.active == true
select new { DisplayText = p.departmentNameEn,
Value = p.departmentId };
return departments.ToArray();
}
バインドする前に、この配列にオブジェクトを挿入したい
object =new { DisplayText = "Choose", Value = 0 };