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, I really like the NHibernate designer - great job. I have a question about code generation. It's possible to suppress code generation on a property-by-property basis for properties defined by the entity itself. Is there a way to do the same with properties generated for associations? For example, lets say I have two entities, Parent and Child. Parent will have an IList of Childs and each Child will have a back reference to Parent. I want the designer to continue generating XML mappings to define this association but I want to suppress the generation of the matching C# properties. The reason is that our entities implement an interface. The interface requires Parent to return a list of IChild rather than a list of Child. The designer knows nothing about IChild so the property it generates is IList<Child>. I have factored this out into a partial class where I define the property as IList<IChild>, but each time the model is changed I have to manually delete the conflicting generated IList<Child> property. Cheers. |
|
|
Hi Colin, No problem -- this will be in the next update, which should appear in the Visual Studio gallery in the next day or so. Let us know if you run into any bugs or issues! |
|
|
Hi Ivan, Thanks for your response. I have downloaded the latest update through the main download page - can't access the gallery due to firewall restrictions. Can you tell me where the new option is located? It doesn't appear on the associations property list. Cheers. |
|
|
Hi Colin, I've updated the copy on the website for you -- sorry about that. I had only pushed the build to the Visual Studio Gallery for the moment. You will need to re-download the VSIX from the download page on our site. John-Daniel |
|
|
Hi John-Daniel, I've re-downloaded the new VSIX file but still can't see where I can select to suppress the properties generated by associations. Could you please explain the process for doing this? Cheers, Colin |
|
|
Hi Colin, If you select the association arrow and look in the Properties box, you should see an entry called Generation. Switch this to MappingOnly and you should be good to go. Screenshot attached. If you're not seeing the Generation options, could you jump into Extension Manager and check the version of NHibernate Designer? (Should appear in the right-hand sidebar.) Thanks! |
|
|
Hi Ivan, I've re-checked the association properties but do not see an option for code generation. When sorting the properties by category, I don't see a code generation category. I tried creating a new model to see if that would make a difference but no luck. Under tools / extension manager, the version number is 1.0.603.18527. I have also tried uninstalling and reinstalling the version I downloaded this morning. I appreciate your assistance on this. :) Cheers. |
|
|
Hi Colin, The version we updated to was 1.0.621.18655, so I suspect that perhaps you're working behind an aggressive proxy cache or something. To work around that possibility I have re-hosted the file temporarily for you so hopefully your proxy cache won't relise it's the same file: http://assets.mindscape.co.nz/Mindscape.NHibernateModelDesigner.vsix Try uninstalling first and then installing this VSIX. It shouldn't be required but weirder things have happened! John-Daniel |
|
|
Hi John-Daniel, That did the trick. I can see the property setting for the one to many associations now - works like a charm. :) Sorry to be a bother - would it be possible to have this option available for all association types? We have a one to one and a couple of many to many associations that we'd like to treat the same way. Cheers. |
|
|
Hi Colin, We'd be happy to do that for you. Can you give me some idea of the urgency? We're hoping to release an update later this week and it would make life slightly easier for us to slip this support into that update rather than having to do an interim drop of v1. |
|
|
Hi Ivan, At the moment I'm the only one working on the model so it's not urgent enough to interrupt your release schedule. If this could be included later this week or next week that would be great. I really appreciate the support you guys have given me on this - thanks a lot! Cheers, Colin |
|
|
Hi Colin, Sorry, the release took longer than we anticipated (don't they always -- we should have anticipated that), but it's now out and includes the association updates. Let us know if you run into any problems! |
|