我正在使用带有 DbContext 的 EF4.3。
我正在尝试查看本地缓存中的内容,但尽管尝试了几次,我仍然收到运行时错误消息。
这是我的最后一次尝试:
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; }
}