Hello, Is there a way to setup Domain to generate views (like in Do 3.X) ? This would be useful to maintain application : let's suppose your application (which uses DO.net) is crashing and you want to access the database with a GUI (SQL Server Management Studio) to change entities to get it working again : views can a time saver if you have a complex model (like we do). Updated at 07.05.2010 8:03:40I was thinking it would not be too difficult to create the views manually using TypeInfo (and its subclasses). But if I can get them from Query.All<t>(), it's event better. So here is the question : is there a programmatic way to get the sql for Query.All<t>() ? Updated at 07.05.2010 15:04:05Well, that's not quite so easy, when you don't know the internals of DataObjects 4 code. ;) I've not been able to extract just the SQL command text from this (interesting) ToString() (and I dont' want to parse the result text ;) ) . Well that's not that important for us : this can wait. This thread was imported from our support forum. The original discussion may contain more detailed answer. |
See Console Sample and this method: http://goo.gl/0o6K It must print underlying SQL for queries sent by DO4. If there are parameters, everything becomes pretty complex; but if there are no parameters, it must be easy to extract SQL from such IQueryables. |
Unfortunately the answer is no, as DO4 doesn't use views for queries as DO3 did, we even haven't implemented the functionality for creating and maintaining views.
So the only possibility I could suggest for now is to make this as an add-on to DO4.
You can also create views manually - from SQL queries executed for Query.All<t>().