I downloaded an example of the online store Magazine SportStore, which was created according to the book ASP.NET MVC 5 Freeman. But the project does not start, it gives this error:
Anonymous of type 'System.Data.Entity.Core.EntityCommandExecutionException occurred in mscorlib.dll but it was not handled in user code
Additional information: error occurred while executing the command definition. See the inner exception for details.
System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---> System.Data.SqlClient.SqlException: Invalid column name 'ImageMimeType'. at System.Data.SqlClient.SqlConnection. OnError (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
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); }
ImageMimeTypefield? - Igor