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:40

I 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:05

Well, 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.


asked May 04 '10 at 08:33

olorin's gravatar image


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.

(May 04 '10 at 08:33) Dmitri Maximov Dmitri%20Maximov's gravatar image

You can also create views manually - from SQL queries executed for Query.All<t>().

(May 04 '10 at 08:33) Alex Yakunin Alex%20Yakunin's gravatar image

One 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.

answered May 07 '10 at 08:15

Alex%20Yakunin's gravatar image

Alex Yakunin

Your answer
toggle preview

powered by OSQA