我正在开发一个Intranet应用程序,并希望使用现有组织Active Directory进行用户身份验证和基于策略的角色授权.
有人能指出我正确的方向吗?我有点困惑(实际上很困惑).
谢谢
我不确定我做错了什么.我想返回要在下拉框中使用的值/项对的列表.我收到以下错误.
Cannot implicitly convert type
System.Collections.Generic.List<System.Web.Mvc.SelectListItem> to
System.Collections.Generic.List<string>
Run Code Online (Sandbox Code Playgroud)
导致错误的方法如下.
方法
//Get the shift list based on StationId which is foreign key in Shifts table.
public List<string> GetShiftsByStationId(int stationId)
{
//Created DataContext to query DB.
using (DataManager db = new DataManager())
{
//returns all the records from table based on StationId in list format.
return db.Shifts.Where(query => query.StationId == stationId).Select(q => new SelectListItem { Value = q.ShiftId.ToString(), Text = q.Code }).ToList();
}
}
Run Code Online (Sandbox Code Playgroud)