IRepositoryBase
IQueryable<T> GetAll(Expression<Func<T, bool>> predicate = null, params Expression<Func<T, object>>[] includes);
存储库库
public IQueryable<T> GetAll([OptionalAttribute][DefaultParameterValueAttribute(null)]Expression<Func<T, bool>> predicate, params Expression<Func<T, object>>[] includes)
{
var set = CreateSet().IncludeMultiple(includes);
return (predicate == null) ? set : set.Where(predicate);
}
IAccountService
IEnumerable<int> GetAllReferenceIds();
账户服务
public IEnumerable<int> GetAllReferenceIds()
{
var accountOwners = _accountOwnerRepository.GetAll();
return accountOwners.Select(m => m.ReferenceId).ToList();
}
帐户控制器
public ActionResult ReferenceIdPartial()
{
ViewData["AccountOwners"] = accountOwnerService.GetAllReferenceIds();
return PartialView();
}
MVC 部分视图- devexpress 组合框 mvc 扩展
settings.Properties.Columns.Add("ReferenceId", "Reference Id", Unit.Percentage(100));
错误 - 未找到列 ReferenceId
我正在通过 GetReferenceIds() 发送一个 int 集合
有没有办法从 Controller 调用列。AccountOwner(a=>a.ReferenceIds, select ReferenceIds) 之类的东西 - 我应该能够获取列名和数据。
谢谢你的时间。