Search This Blog

Tuesday, March 29, 2016

Still fighting with my code...

I'm currently trying to convert a "Database First" design with Entity Framework to "Code First", sadly things don't work as smoothly as I would love to.

I thought I could simply use the TT model to generate the classes with the required changes to have then a code which would work without EDMX file (which is an XML with the diagram and the mapping).

First problem is that the T4 format (TT file) somehow don't get code completion nor coloring by default. I wonder why as that's what Microsoft uses anyhow. I had to download a plugin to get the coloring but the code completion don't work (unless you pay for a license). Understanding how the T4 works takes already quite some time, with included files which comes from the VS directory itself.

Solving for example the addition of the table name took me more than half a day, but let's say this part is over.

Now blame me for my lack of knowledge but I don't know how the two ways binding of tables work and currently it doesn't work as expected. Sadly documentation on the net is messy, with mix of older versions of Entity Framework and with people having tons of different issues which never seems to relate to mine.

Not really a good day, and this is already not the first one invested in this trial path. I still have hopes to succeed at some point, but it is by far something which could be made a lot more straight forward (a right click on the EDMX for example?).

No comments:

Post a Comment