BUG:Unmap and Map will change names

5 posts, 0 answers
  1. Chris
    Chris  avatar
    42 posts
    Member since:
    Apr 2009

    Posted 30 Sep 2011 Link to this post

    Hi,
    I'm using pascal case field names in DB.
    Reading DB fields keep the pascal case, however, if I unmap and create map the table from scratch, the property names will change with lower case and underscores.
    Once table is unmap, I can't remap using pascal case anymore.
    This is causing quite a bit of problem.

    In the model setting, there are naming rules whether to remove underscores and to interpret underscores as word delimiter.
    I have them uncheck, thus, it shouldn't change field name.

    Can you please take a look at this?

    Thanks.


    ps. I'm having lots of problems with inheritance, I think you sould try to test using mid-to-large size project to see all the problems users are facing. I still haven't given up because I already invested quite a bit of time but my patiences are running low.
  2. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 30 Sep 2011 Link to this post

    Hi Chris,

    This is definitely not the expected behavior. However, I was not able to reproduce it on my side.
    Could you please give me some more information about your setup - is there any inheritance involved in the class you are mapping/unmapping? It would be best if you could send me your rlinq file in a support ticket (you will not be able to attach it to the forum post) and describe what steps need to be performed to see the problem - how exactly you are unmapping/mapping the table, etc. 

    Regards,
    Alexander
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's SQL Server Community Awards. We are competing in TWO categories and every vote counts! VOTE for Telerik NOW >>

  3. DevCraft banner
  4. Chris
    Chris  avatar
    42 posts
    Member since:
    Apr 2009

    Posted 30 Sep 2011 Link to this post

    Hi,
    Let me put it this way.
    Create Empty Model with Pascal Case property and map to a table.
    Table field is always convert Pascal Case to lower case and underscores.
    Like wise, when you read in Pascal Case from DB and remap to table (by deleting old table and map), it will always convert to lower case and underscores.
    You will then cannot map to Pascal Case in the DB anymore.

    Thanks.
  5. N Mackay
    N Mackay avatar
    228 posts
    Member since:
    Dec 2010

    Posted 04 Oct 2011 Link to this post

    Chris,

    I also had that issue but ignored it as stored procedure mapping issues were a bigger stumbling block for us.
  6. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 05 Oct 2011 Link to this post

    Hi Chris,

    Thank you for the clarification, I think I understand the case now. Please note that the naming rules you can set in the model settings apply only to classes being generated from tables (reverse mapping from a database). If you delete the table from the model and try to create it again, based on your persistent class (forward mapping from a class), another naming mechanism will be used to generate the table/column names, which actually creates the lower letters and underscores you see. Unfortunately at the moment there is no way to configure this naming mechanism, but this is on our TODO list. 
    If you want to continue using forward mapping, you can always edit the column names manually in our Table Editor, before creating/updating the database from your model.
    I hope that helps.

    Best wishes,
    Alexander
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's SQL Server Community Awards. We are competing in TWO categories and every vote counts! VOTE for Telerik NOW >>

Back to Top
DevCraft banner