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
|
Jeremy, I presented at the Orlando Code Camp on ASP.NET MVC and showed off LightSpeed and a Custom T4 Template, controller.tt, that generated a CRUD controller for a single entity similar to what Rob Conery is doing here. Care to do what Rob is doing in the above video for LightSpeed? I would love to have a sample MVC Project that contains the custom controller and view T4 Templates to quickly pull off database-driven web apps via MVC and LightSpeed. You can hook in the xVal Code, a custom modelbinder and other things so we can see how you think LightSpeed should be used with MVC for at least simple CRUD applications. This would be so cool to add to the Community Code! Regards, Dave |
|
|
Giving this a little bump! Not sure the Community Area gets as much love as the LightSpeed Forum :) Regards, Dave |
|
|
Thanks David - good suggestions :) Is the code you showed in Orlando available on your blog? And if so, may we use it as part of this effort? We have a number of screencasts we need to record for LightSpeed 3.0, so we will try and knock this off at the same time.
Jeremy |
|
|
I too have delved into the T4 template realm by modifying the controller.tt that David references above. In my exploratory project I have SubSonic pointed to the same database as LightSpeed. The controller template generates code that uses a LightSpeed repository. I have found this template quite easy to modify. What is more difficult to modify is the view templates. Presently the view templates all use SubSonic to generate code based on LightSpeed objects. The HTMLHelper class (I forget the name at the moment) uses SubSonic to determine the field type and generate the appropriate HTML. For this project I would like to completely replace SubSonic with LightSpeed. In order to do that I will need the ability to iterate through the properties of an Entity to generate the appropriate HTML. Does this exist and I just haven't stumbled across this yet? |
|
|
We don't expose the set of properties in any LightSpeed-specific way, though if the model is compiled you can obviously get at them using Reflection. If you're looking for compile-time information and you are using the designer then you could read the info out of the .lsmodel file -- we don't have a documented API for doing this but we would be happy to provide guidance. If you're looking for compile-time information and you are NOT using the designer, i.e. you need to extract info about entity classes from C# or VB source code, you need to delve into the Visual Studio FileCodeModel. If you let us know which of these three scenarios is relevant to you then we can provide more info for you. |
|
|
Thanks Ivan. This has been a big help. Thanks to the information you provided I have located some information on using the FileCodeModel in a T4 template. I will post back my results. Thanks |
|
|
nice i love it |
|