I am trying to implement the following code to map a database to a POCO that has slightly different Property names then the corresponding columns, and a slightly different class name than the table name.
![]()
The problem is there is no method called MapSingleType. I have the following two methods available:
public EntityTypeConfiguration<TEntityType> Map<TDerived>(Action<EntityMappingConfiguration<TDerived>> derivedTypeMapConfigurationAction) where TDerived : class, TEntityType;
public EntityTypeConfiguration<TEntityType> Map(Action<EntityMappingConfiguration<TEntityType>> entityMappingConfigurationAction);
However, I can’t find any examples of how to use them and I’m hoping to find the MapSingleType method since that works perfect for the very large number of columns I have to map.
I have downloaded CTP4 from here
And I am using EF 4.0.3
Here is the code I have so far:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
using PlayingWithEF.DAL.CLS.Classes;
using System.Data.Entity.ModelConfiguration;
namespace PlayingWithEF.DAL.CLS.Context
{
public class CLSContext : DbContext
{
public DbSet<Listing> Listings { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<Listing>().Map(...?)
}
}
}
You’re going to have to map each property individually: