我正在使用EF4.3,使用DbContext。
我正在尝试查看本地缓存中的内容,但尽管尝试了很多次,但仍然会收到运行时错误消息。
这是我的最后一次尝试:
var entity = Uow.Context.Set<Store>().Local;
foreach (var store in entity)
{
Response.Write(store.StoreId + "<br>");
}
有人帮忙吗?
商店类
public partial class Store
{
public Store()
{
this.Deals = new HashSet<Deal>();
this.StoreSubcategories = new HashSet<StoreSubcategory>();
}
public int StoreId { get; set; }
public int StoreStatusId { get; set; }
public int ContentSourceId { get; set; }
public string Name { get; set; }
public string Subdomain { get; set; }
public string Domain { get; set; }
public string HomePage { get; set; }
public string BackColour { get; set; }
public string ForeColour { get; set; }
public System.DateTime ActiveFrom { get; set; }
public Nullable<System.DateTime> ActiveUntil { get; set; }
public System.DateTime CreatedOn { get; set; }
public virtual ICollection<Deal> Deals { get; set; }
public virtual Stores_Partner Stores_Partner { get; set; }
public virtual ICollection<StoreSubcategory> StoreSubcategories { get; set; }
}
答案 0 :(得分:0)
实体类和aspc页面之间的冲突,类似地命名为&#39; store&#39;。