Page 1 of 1

regenerate lqml file from design view?

Posted: Thu 29 Dec 2011 18:35
by dsdevoy
I am evaluating dotConnect for SQLite (with VS2010/.NET 4.0) and generating a LINQ2SQL DataContext from a small existing database (DB first model). One of the tables models a tree structure, with a parent "foreign" key to the same table. The entity name is Portfolio and the "foreign" key is ParentId, annotated as FK_Parent in the existing database. The generated lqml creates a generically named association for this as "Portfolio_Portfolio" with members with similarly generic names ("Portfolios", "Portfolio1").
I can edit the association in the design view, but the Designer.cs file is never updated, nor is the lqml file.
"Run custom tool" in the context menu, as I discovered, runs the Entity Framework tool and totally destroys the lqml file. :oops:
Other than manually editing the Designer.cs file, I can see no way to update the association names from the generated names.
Am I correct in assuming that a manual edit is the only option for this?
Thanks.

Posted: Fri 30 Dec 2011 16:57
by StanislavK
Generally, you have to rename the navigation properties and save the model. The code should be re-generated automatically just after the model is saved.

The issue you are encountering may be caused by an invalid custom tool specified for the .lqml file. The proper tool is 'DevartLinqToSqlGenerator'. Please ensure that it is set for your model.

If the problem persists, could you please send us the model with which it occurs so that we are able to analyze the issue in more details?

Posted: Fri 30 Dec 2011 18:17
by dsdevoy
Thanks for the reply. I'm not sure what the problem WAS, since I have gone through many thrashing iterations of regenerating the simple project and model, but another fresh regeneration of the project and model seems to have eliminated the problem that I was seeing. Sorry I cannot provide you with the reproducible error -- chalk it up to a newbie crashing around in the china shop :roll: . Another "PICNIC" problem..."Problem In Chair, Not In Computer".