mthamil / EFDocumentationGenerator

A Visual Studio plugin for the Entity Framework designer which pulls MS_Description properties from a database and populates an entity model with them.
Apache License 2.0
11 stars 5 forks source link

Does not support renamed fields #18

Closed JimmyRascon closed 6 years ago

JimmyRascon commented 6 years ago

I use uppercase names with underscores in my database and Pascal Case names in the edmx file. When the field's name in the edmx file does not match the column's name in the database, it does not copy the MS_Description.

Example: (column name) -> (field name)

TITULO -> Titulo -> WORKS TITULO -> Prueba -> DOES NOT WORK FECHA_INICIO -> FechaInicio -> DOES NOT WORK

mthamil commented 6 years ago

Thanks for your feedback. Would you happen to have an example edmx available? The extension uses the edmx to map between database names and entity names, in particular the EntitySetMapping sections.

JimmyRascon commented 6 years ago

Hi, the extension works well mapping database names and entity names, but does not work for column names

Here is an example: TestEdmx.zip

<EntitySetMapping Name="TEST_PRODUCTS">
  <EntityTypeMapping TypeName="TestModel.Products">
    <MappingFragment StoreEntitySet="TEST_PRODUCTS">
      <ScalarProperty Name="Id" ColumnName="PRODUCT_ID" />
      <ScalarProperty Name="Name" ColumnName="NAME" />
      <ScalarProperty Name="Description" ColumnName="DESCRIPTION" />
      <ScalarProperty Name="AlternativeName" ColumnName="ALT_NAME" />
      <ScalarProperty Name="ShippingCost" ColumnName="SHIPPING_COST" />
    </MappingFragment>
  </EntityTypeMapping>
</EntitySetMapping>

For example, it doesn't find a description in the database for "AlternativeName", because the column name is "ALT_NAME".

mthamil commented 6 years ago

Ohhh ok. That seems fairly simple to fix. I will try to get this done over the weekend. Thanks for your help.

JimmyRascon commented 6 years ago

It works nice now, thanks!

mthamil commented 6 years ago

Great to hear!