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 Guys, I wanted to serialise some object to a string field in the DB, and thought I could use IFieldConverter. However, I am getting an error...
I am using the following code, although this doesn;t seem to be getting hit...
And the following User Defined Type
Cheers, Sean |
|
|
No, you have specified a non generic type as the CLR name but the actual type has generic parameters. Ill have a look at making a tweak to support this so it accepts anything which would match the base signature on the assumption its a generic type and you will know what you are doing. Ill post an update once Ive had a chance to progress this further, so hopefully will have something for the nightlies later this week.
|
|
|
Awesome - thanks Jeremy. |
|
|
Ive merged the changes for this today so this will be available in the next nightly build. For your UDT specify Dictionary Let us know if you run into any other issues after updating.
|
|
|
Thanks for this Jeremy, it's great!! There is just one thing to be aware of, I'm not sure anything can really be done about it either, although you may have some suggestions : ) If it is say a Dictionary type, and you change the content by editing or adding to it directly or by reference the entity is not marked as modified. Now I understand that LS wouldn't change the entity state in this instance as there is no trigger in the dictionary to let it know. Is there some way to force a changed state on the entity here, or should we manually make a change to a field to create the changed state? Cheers, Sean |
|
|
Yep - any manipulation of a properties object state without causing re-assignment is not going to trigger an indication to the entity that the state has changed, similarly on assignment we do an equality check to determine if the object is new or is just the same value being re-assigned before making the property as dirty (which in turn changes the EntityState) so in the case of a Dictionary you would be still dealing with the same object if you re-assigned it. A couple of ways I can think of that you can handle this would be:
There isnt really an elegant way of handling this, and Dictionary doesnt seem to expose any change events so I would be thinking the second approach might be the best here. YMMV :)
|
|