public ViewResult List(string category,int page = 1)
{
ProductsListViewModel viewModel = new ProductsListViewModel
{
Products = repository.Products
.Where(p => category == null || p.Category == category)
.OrderBy(p => p.ProductID)
.Skip((page - 1) * PageSize)
.Take(PageSize),
PagingInfo = new PagingInfo
{
CurrentPage = page,
ItemsPerPage = PageSize,
TotalItems = category == null?repository.Products.Count():repository.Products.Where(e => e.Category == category).Count()
},
CurrentCategory = category
};
return View(viewModel);
}
가 있다고 개념적 모델 유형 찾을 수 없습니다 "SportsStore.Domain.Concrete.ORM.Product에 대한 개념 모델 유형을 찾을 수 없습니다를." 수동으로 추가하는 SportStore.edmx 파일과 관련이 있다고 생각하지만이 파일은 이미 존재하는 것처럼이 파일을 읽었을뿐입니다. 그래서 ORM을 직접 만들어야하는데 예외가 throw됩니다. 나는이 문제 (thx)를 검사하는 방법을 안다.엔티티 프레임 워크 오류 :