在模型生成期间检测到一个或多个验证错误:
SportsStore.Domain.Concrete.shop_Products :: EntityType'shop __Products'没有定义键.定义此EntityType的键.
产品:EntityType:EntitySet'Products'基于类型'shop_Products',没有定义键.
public ViewResult Index()
{
ProductsListViewModel viewModel = new ProductsListViewModel
{
Products = repository.Products
.Where(p => p.CategoryId == 100)
.OrderByDescending(p=>p.ProductID)
.Take(5)
};
return View(viewModel);
}
@foreach (var p in Model.Products)
{
<a href="">@p.ProductName</a>
}
public class shop_Products {
public int ProductID { get; set; }
public string ProductName { get; set; }
public int CategoryId { get; set; }
public Nullable<int> CategoryPropertyId { get; set; }
public string PropertyValue { get; set; }
public Nullable<int> …Run Code Online (Sandbox Code Playgroud) 我的代码是
<br />
<br />
<br />
<br />
<p>qqqqq</p>
<br />
<p>222</p>
Run Code Online (Sandbox Code Playgroud)
和JS是
$('p:first').prevAll('br').remove();
Run Code Online (Sandbox Code Playgroud)
如何删除所有