- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
foreach (Admin _admin in _admins.Where(a => a.Login == _login))
{
if (_admin.Password == _password)
{
SessionObj = new Al2AllAuth
{
AccessId = _admin.Type,
Ename = _admin.Name,
Whoid = _admin.Id
};
var _type = (AdminTypes) _admin.Type;
switch (_type)
{
case AdminTypes.FirstType:
return RedirectToAction(c_adminActionName, c_userControllerName);
case AdminTypes.SecondType:
if (string.IsNullOrEmpty(model.Page) || string.IsNullOrEmpty(model.Uid))
throw new ArgumentException(InternalResources.EmptyPageOrUid, "model");
return RedirectToAction(model.Page, new { uid = model.Uid });
default:
break;
}
}
else
{
return RedirectToAction(_errorActionName);
}
}
Лямбда в foreach очен смутила... Зачем?