Guest User

Guest User

  • Tech Writer
  • 357
  • 116.1k

EF and Code First

Apr 30 2013 7:16 AM

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?


Answers (3)