Error with MapSingleType

asp.net-mvc-3 entity-framework

Question

I create a project by MVC3 and use EFCode first for DataAccess Layer.

in my DataBase I have PackaginInfo Table, and in project I carete Package Class, this is my code:

public class Package
{
    public decimal PackageID { get; set; }
    public decimal Title { get; set; }
    public decimal Cost { get; set; }
    public bool isFree { get; set; }

}


public class ParandShopsEntities : DbContext
{       

    protected override void OnModelCreating(System.Data.Entity.ModelConfiguration.ModelBuilder modelBuilder)
    {
        modelBuilder.Entity<Package>().MapSingleType().ToTable("PackagingInfo"); 

    }

    public DbSet<Package> PackagingInfo { get; set; }
}

when i debug my project i get error: Error System.Data.Entity.ModelConfiguration.EntityTypeConfiguration' does not contain a definition for 'MapSingleType' and no extension method 'MapSingleType' accepting a first argument of type 'System.Data.Entity.ModelConfiguration.EntityTypeConfiguration' could be found (are you missing a using directive or an assembly reference?) E:\Projects\ein co\89-11-23\Parand\MvcApplication1\Models\ParandShopsEntities.cs

pls. help me

1
3
7/11/2011 8:33:05 AM

Popular Answer

In CTP5, you now just call

modelBuilder.Entity<Package>().ToTable("PackagingInfo"); 
8
2/12/2011 8:48:14 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow