This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, we have been using LightSpeed for quite a while and are now looking for seperating the model into multiple model files as e.g. some views are not linked to any other entities this should be possible with linked models. Basically it seems to work but we also use T4 generated code as described in: We have an original model called "Model.lsmodel" and for our test we have generated a second model called "ModelViews.lsmodel" (Same settings but "Is Linked Child" is true). We moved one view from the original to the new model file and the generated code in Model.cs and ModelViews.cs fits. We the checked the code generated by our tt-file and the moved view was missing. Which was no surprise as the view is no longer in the file:
We then changed this line to ModelViews.lsmodel:
This left us with an "empty" generated file (where empty means that no entites have been processed but the default texts like usings are there) Are we doing something wrong? |
|
|
Hi, Curious - sounds like a bug. Just to clarify - when you setup the second T4 template, did it fail to create the entities in both of the files, or just in the ModelsView output? Any extra information is greatly appreciated on this (if you could supply a model and the T4 files, that would be even better - you could email them directly to support@mindscape.co.nz if you don't wish to put them on the forum). Kind regards, John-Daniel Trask |
|
|
Hi, it seems I must have made a mistake in the first try. As I made an example the result was like the following: The t4 which referenced the model.lsmodel produced output for all entities in this file and the other t4 produced output for all entities in the modelViews.lsmodel. This seems to be basically correct. As we would like to add multiple linked models we would like to reference multiple files in one t4-template. Is this possible? Kind regards |
|
|
Hi, I don't believe it's possible. Effectively you a T4 template takes an input, transforms it and outputs it (so model in, code model out). Having said that, we don't internally push T4 templating hard, so it's perhaps something we've missed when using it. Just to clarify: You're not successfully generating the code you want, but you're looking to see if it might be possible to use the T4 templates to generate a single output that combines all the models being fed in. Is that correct? John-Daniel Trask |
|
|
Hi, I am currently able to create the output I want for one model file and it does not matter if it is a linked model or not. I would like to create one output file for multiple model-files. Currently it works like this:
and we iterate through all entities by:
For us it would be really good to be able to use something like this:
as both are the some model (master and liked model) the iteration through all entities could remain the same. Note: As my initial comment based on a mistake on my side (I don't know what I did wrong but now it works) I would mark this as 'nice to have'. Thank you for your help. |
|