Last post Feb 19, 2010 08:33 PM by sjnaughton
Feb 12, 2010 10:53 AM|klca|LINK
If I were to develop a Dynamic Data Entities Web Site as to have reflected automatically in my application every single change that I had made to my database schema, then ... I ask:
Will I have to rebuilt the web site as to also get reflected the changes that I have made to the MetaData file (adding for example new columns) or those changes reflected automatically if I just add them in the .cs MetaData partial class file?
I ask this because if my site were alredy working in production will it mean that I should have to have all my users disconnected or the application shutdown and recompile/reload the application again as to see the changes reflected in their screens or is
this gotten automatically?
Carlos Porras (El Salvador)
Asp.Netet Dynamic Data Metadata files
Feb 13, 2010 01:26 AM|danludwig|LINK
The short answer to your question is, yes, the app must be re-compiled.
The EntityDataModel (edmx file) auto-generates a class. Any changes to the database will first require you to update the EDMX file, which will then generate a new class, which will then need to be compiled. You don't necessarily need to update the MetaData
class, but you can, and this also requires a recompile. Any time you change source code, it needs to be compiled before it can run with the new changes.
It doesn't necessarily mean your app needs to be shutdown or disconnected though. You can just copy and paste the new DLL file(s) in to the server, and it will load them on the next request. It may log your users out, so you should still to the update when
there is relatively low activity expected.
Also, keep in mind that you will have to update the Database in your server for the new DLL's to work.
Feb 13, 2010 07:20 AM|sjnaughton|LINK
Hi Calros, you must recompile/restart the application, however in VS2010 .Net 4.0 DDv2 you can do
this will cause the metadata to be reloaded at runtime.
Feb 18, 2010 09:57 AM|beeps4848|LINK
Where would you use Table.ResetMetadata()? I mean, would you leave it in your app so metadata is never cached?
Feb 18, 2010 04:49 PM|sjnaughton|LINK
Hi Bob, you would use it on the page, but you could call it from anywhere you have access to the Table.
Dynamic Data 4
Feb 19, 2010 06:33 PM|klca|LINK
I have a dynamic web site running in a production like environment and it just happens that I accidentally made a change in my MetaData file and without any further ado or compilation or without doing anything else ...
¡¡¡¡ IT JUST APPEARED CORRECTLY DISPLAYED ON MY SCREEN WITH THE CHANGES I HAD ALREADY MADE ON IT !!!!
On the other hand, I was using
Feb 19, 2010 06:59 PM|klca|LINK
I have 5 commong fields in all tables of my ERD (almost 150 tables)whcch I am implementing as audit trial/control/validation and I think there might be a way of applying the [ScaffoldColumn(false)]
to all of them at once or do I have to repeat the code 150 times?
Feb 19, 2010 08:33 PM|sjnaughton|LINK
Hi Carlos, Yes there is I have used this several times I will try and explain I use a type descriptors see:
Dynamic Data – Custom Metadata Providers and then add code to auto scaffolde false:
private String _auditFields = new String
This is my list of fields to exclude.
I add the above code to the GetProperties() method of the DefaultAttributesTypeDescriptor
Custom Type Descritptors