0

I have a custom class that has an implicit conversion with string. I'm using POCO classes in c# with EF6.0 and I'd like to be able to declare a property like this:

[Column("TABLE_COLUMN_NAME", TypeName = "char")]
public virtual CustomClass ClassColumnName { get; set; }

Then have entity framework just assign the value taking advantage of the implicit conversion. However when I try to run this code I get an error like Error 3002: Problem in mapping fragments. CustomClass has an implicit conversion operator setup for both going to and coming from string but it appears that EF wants to treat the whole type as if it were a table and fails the mapping. Any guidance would be appreciated.

Mykroft
  • 13,077
  • 13
  • 44
  • 72
  • possible duplicate of [How do I eliminate Error 3002?](http://stackoverflow.com/questions/2835928/how-do-i-eliminate-error-3002) – MethodMan Aug 19 '14 at 18:31
  • His issue is with a column being misidentified as a primary key. That is not the case here. – Mykroft Aug 19 '14 at 18:33

0 Answers0