This is a migrated thread and some comments may be shown as answers.

Fluent mapping and enumds

1 Answer 49 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Herbert
Top achievements
Rank 1
Herbert asked on 07 Aug 2012, 05:48 PM
Hi,

I've just downloaded the free edition and experienced a problem with fluent mapping and enums.
This is my class:

public enum SomeEnum
{
  TestA,
  TestB,
  TestC
}
public class SomeClass
{
  public int Id {get;set;}
  public string Bla {get;set;}
  public SomeEnum Test {get;set;}
}


And I created the following fluent mapping configuration:
MappingConfiguration<SomeClass> cl= new MappingConfiguration<SomeClass>();
cl.MapType().ToTable("SomeTable");
cl.HasProperty(x => x.Id).IsIdentity(KeyGenerator.Autoinc);

This results in a table with the Id and Bla column only. The Test column is missing.
If I use explicit mapping (MapType(x=> new {......}) ) the Test column is also in the database table.

I really like the implicit mapping - how can I fix this ?

Thank you

Herbert


1 Answer, 1 is accepted

Sort by
0
Accepted
Zoran
Telerik team
answered on 10 Aug 2012, 04:29 PM
Hi Herbert,

 We verified and confirm this is a bug on our side, regression from about 2 months ago. I can assure you that it will be fixed for our next release. In the meantime, you can use the explicit mapping approach for this particular property.

Thanks a lot for reporting this bug to us. Your Telerik points have been updated.

Kind regards,
Zoran
the Telerik team
Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
Tags
Data Access Free Edition
Asked by
Herbert
Top achievements
Rank 1
Answers by
Zoran
Telerik team
Share this question
or