Fluent mapping and enumds

2 posts, 1 answers
  1. Herbert
    Herbert avatar
    4 posts
    Member since:
    Aug 2012

    Posted 07 Aug 2012 Link to this post

    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


  2. Answer
    Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 10 Aug 2012 Link to this post

    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!
  3. DevCraft banner
Back to Top