我在這裏爲表進行映射..如何在這裏映射存儲過程?如何在ASP.NET MVC 3實體框架中使用DBContext映射存儲過程
public class AppDBContext : DbContext
{
public DbSet<UserAccount> UserAccount { get; set; }
public DbSet<GetUserAccounts> GetGetUserAccounts { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<UserAccount>().ToTable("UserAccount");
modelBuilder.Entity<Customer>().ToTable("Customer");
base.OnModelCreating(modelBuilder);
}
}
如果您使用EF代碼優先,也許這個答案可能有所幫助:http://stackoverflow.com/a/6622949/390819 – GolfWolf