我正在尝试将Entity Framework 4.1 RC与SQL Server 2005实例一起使用.我创建了一个空数据库,我想将我的POCO对象保存到它.我的POCO看起来像:
public class Cart
{
public Cart()
{
this.CartId = Guid.NewGuid();
}
public Guid CartId { get; set; }
public decimal TotalCost { get; set; }
public decimal SubTotalCost { get; set; }
public decimal Tax { get; set; }
public decimal EstimatedShippingCost { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
我的CartContext是:
public class CartContext : DbContext
{
public DbSet<Cart> Carts { get; set; }
public DbSet<Attribute> Attributes { get; set; }
public DbSet<AttributeItem> AttributeItems { get; set; …Run Code Online (Sandbox Code Playgroud)