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! Is there any way to control of generating strong-typed unit of work? For example, I want to turn off generating or set visibility to "private". Thanks! |
|
|
If you're targeting .NET 3.5 or above, we will always generate a strong-typed unit of work class. You would need to edit the code generation templates, or target .NET 3.0 or below, to suppress it. For info on editing code generation templates see: http://www.mindscapehq.com/blog/index.php/2009/09/16/customising-lightspeed-entity-templates/ The strong-typed unit of work template is in DataContext.vm: you could comment out the contents of that file, or hardwire it so the class is always internal. |
|
|
Hi, Ivan! |
|
|
Hi Dmitriy, The multiple developers thing shouldn't be an issue, because you can set up per-project templates with relative paths, which means you can put your edited templates in source control, and developers will get the custom templates when they get the project. The multiple models thing is a bit trickier. At the moment, I think the only way to do this is to use per-project templates, and put the models in different projects. This will result in multiple small projects but from the consumer's point of view that shouldn't be a big issue unless you are shipping your libraries to third parties. We don't particularly want to clutter up the designer with code generation options if we can avoid it (it has enough already!) but one thing we could do is add extension property support at the model level. This would allow you to define your own model properties (e.g. "UOW Visibility") and consume those properties from your custom templates. It would work in the same way as the existing entity and property extension properties (see http://www.mindscapehq.com/forums/Post.aspx?ThreadID=1956&PostID=5101). We'd be happy to look at implementing this for you but we would be interested to hear your use case, in case it is something that might be more widely applicable or that we could solve in a different way -- let us know! |
|