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
|
What you guys think about adding reference to MetaData/ValidationData object through a attribute?
|
|
|
Yeah, unspeakably horrible though the "buddy class" system is, it looks like it's here to stay, so it would be a good idea for us to emit that attribute. Note that you can add the attribute yourself in the designer via the Custom Attributes setting (or via a partial class). Also, I believe there are ways to hook LightSpeed validation into ASP.NET MVC using the model binder -- don't know if that would help your intended scenario, but if it sounds relevant then take a look at Jeremy's articles (MVC 1, but hopefully translatable to MVC 2). This one looks the most relevant. |
|
|
Will you guys make the buddy feature? |
|
|
I did think about this some more and I'm a bit doubtful about whether we could do it in a useful way. Just generating a metadata class and attribute in the templates isn't very useful, because you'd end up having to write a partial class anyway: partial class MyEntity { In which case there's almost no overhead in hand-writing the MetadataType attribute on the MyEntity partial class rather than having us generate it. The only thing I could think of that would actually be useful would be to have a one-off "Generate Metadata Class" which would give you a starter implementation of the metadata type and a "Check Metadata Class" which would warn you if the metadata type member names no longer matched up with the correct member names. I.e. we'd have to create and examine external code rather than just updating the templates. It would be quite cool, but it makes it quite a bit more complicated for us. Which approach were you thinking of -- just generating an empty metadata class and attribute for the user to fill in via partials, or creating a starter class which the user then has to maintain? If the former, do you still think there's value in it? Or is there some other approach that I'm missing? |
|