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
|
Hello, I am using the Lightspeed Entities without separate DTO's. The reason for this is that the jquery grid that I am using gets the data from an IQueryable in the controller action. Only with that approach the Linq query is "optimized" and the grid's possibility to sort and page the rows. I have found out that with the source and target attributes of the association properties, I could mark the reference properties with the System.Web.Script.Serialization.ScriptIgnoreAttribute. So the JavascriptSerializer doesn't complain about a circular reference. Is there any global soltution for all associations? I think it is a very tricky, because the model designer doesn't shows the defined attribute in the property list. For the next optimization I have not found the perfect solution. Every of my Entities depends on the base class Entity. Which has some public properties like :
What would be the best way to give them also the ScriptIgnoreAttribute? Many thanks for any advice. Kind regards, Tom |
|
|
Hi Tom, For the associations if you want to handle this globally you will need to customise the templates and add the attribute in so its being automatically added for every association as part of the code-gen. If you go down this route I would strongly encourage you to use per project templates so you can version this along with your code. Ivan wrote about this here: http://www.mindscapehq.com/blog/index.php/2009/09/16/customising-lightspeed-entity-templates/ - You will want to make the modifications in the RelationshipProperties.vm template. For adding that attribute to those properties on the Entity class, no that isn't possible outside of running a custom build of LightSpeed where you have made those modifications yourself.
|
|
|
Hi Jeremy, fine, I have missed the templates totally. Thanks for the advice. This is perfect for me. How easy is it to build a custom Lightspeed with this changes to the Entity class? The point against this, is that I am loosing the future update compatibility. :-( Kind Regards, Tom |
|
|
Hi Tom, You will need a source code license to be able to do this, and you will then be able to make the appropriate mods to the Entity class and compile a custom build for yourself. Given the limited set of changes involved I dont suspect this will present a major problem to re-patch when updating.
|
|