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
|
- Could the datacontracts be generate to files instead of one huge model file? - Could also be nice to have a option for a different "append name" so you can have something else than Dto... - Anything new of option for skipping relations to tables that are excluded/not-included? |
|
|
- It could be nice if datacontracts could be exported one-by-one in a optional directory - Could be nice to have mapped the relations, at least with "id" OrderDto.CustomerId = 412 OrderDto.OrderLines > List<int>() etc... It would perhaps makes this little complex |
|
|
When running lsgen.exe, if think the extensions missing the "this" in AsDto and CopyTo methods...
|
|
|
Is it possibly to make the AsDto and CopyTo more flexible for customizing? Example call partial method such as "XxxCopying(entity, dto)" and XxxCopyed(entity, dto)" like the CopyDtoBase??? Then we can make the customize without changeing the generate files... |
|
|
Since the Id is missing in the contracts, could you guys add generate like this ? MyContract : MyContractBase<int> |
|
|
Or just add in the code and in the mapping ? :-) |
|
|
"Could the data contracts be generated to files instead of one huge model file? ... It could be nice if datacontracts could be exported one-by-one in a optional directory." I originally wanted to generate multiple files but it turns out there are some technical difficulties (related to shared content between the contract types). "Could also be nice to have an option for a different 'append name.'" Sure, but this creates yet one more thing for the user to configure. We generally prefer to trade off flexibility for simplicity unless and until the flexibility is required to solve a problem. If the Dto suffix is causing you a problem, we can look at this for you. "Could be nice to have mapped the relations, at least with 'Id'." Yes, we should probably emit foreign keys. Need to have a think about whether this has an impact on update/inserts though, so we might leave this to users through the partial methods you suggest. No intent to emit the object graph of associated entities, because this is often unwanted and creates lots of complexity (where do you stop?). "When running lsgen.exe, extensions method are missing the "this" in AsDto and CopyTo methods... " We interpret the /linq switch as indicating .NET 3.5 support, so only emit "this" if the /linq switch is present. "Is it possibly to make the AsDto and CopyTo more flexible for customizing? Example call partial method such as "XxxCopying(entity, dto)" and XxxCopyed(entity, dto)" like the CopyDtoBase?" Yes, we can do this -- I will have a look. "Since the Id is missing in the contracts, could you guys add generate like this ? MyContract : MyContractBase<int>" There is already a partial base class (ModelDtoBase) generated with partial methods for copying. You can add an Id property here (though if you have a mix of identity types then you will probably need to get ingenious with the typing). "Or just add in the code and in the mapping ? :-)" No -- the Id property cannot be safely included in general-purpose DTOs, because those DTOs might be sent to an Insert-type method, and LightSpeed could not honour the contract if a client told it to create an entity with a specific ID. And we didn't want to get into the complexity of creating different DTOs for select/update vs. insert...! Thanks as always for the feedback and the suggestions! |
|
|
I've added BeforeCopyXxx and AfterCopyXxx partial methods to the default templates. The updated templates will be included in the nightly builds dated 18 Feb 2009 and above. |
|