none
Instance of type 'xxx' could not be added. This type is not part of the mapped type system. RRS feed

Answers

  • Hi john, I presume this error is thrown in InsertOnSubmit isn't it ? I know one instance that happens when the type can not be tracked by the context via the table you have provided. This usually happens when you inherit from another class that has DataColumn definitions and changes the structure of your entity so that it is not the same entity that the DataContext table refers to.

     

    For inheriting from other classes, you need to use different attributes such as InheritanceMappingAttribute . You can find more about it here : http://msdn.microsoft.com/en-us/library/bb399352.aspx 

     

    Hope this gives some idea.

     

    Sidar

     

    Wednesday, May 28, 2008 3:25 PM

All replies

  • Hi john, I presume this error is thrown in InsertOnSubmit isn't it ? I know one instance that happens when the type can not be tracked by the context via the table you have provided. This usually happens when you inherit from another class that has DataColumn definitions and changes the structure of your entity so that it is not the same entity that the DataContext table refers to.

     

    For inheriting from other classes, you need to use different attributes such as InheritanceMappingAttribute . You can find more about it here : http://msdn.microsoft.com/en-us/library/bb399352.aspx 

     

    Hope this gives some idea.

     

    Sidar

     

    Wednesday, May 28, 2008 3:25 PM
  •  

    That's that's exactly what it was. I was using the base type and setting the mapping property instead of creating the inherited type.  Problem solved! Thanks!
    Thursday, May 29, 2008 12:55 PM