Guest User

Guest User

  • Tech Writer
  • 357
  • 121.1k

EF and Code First

Apr 30 2013 7:16 AM
Hi,

I require an understanding on the Map Method API located in the Entity Framework Namespace.

The Method signature is:-

public EntityTypeConfiguration<TEntityType> Map<TDerived>(
       Action<EntityMappingConfiguration<TDerived>> derivedTypeMapConfigurationAction
       where TDerived : class, TEntityType)

My question is...

Why does the where constraint need to have the TDerived generic placeholder telling it that it must derive from a class (reference type) AND to be of type TEntityType?

I commented out the where constraint and it still seemed to work fine?

Regards






Answers (3)