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 am wanting to use the Dynamic Data support in Lightspeed 2.2 to wire up some simple CRUD functionality. I am using Guids for the Identity Method. In the situation where I have a parent/child relationship in my domain model, I can create parent entities with no problems, but any time I try to create a child entity, I get a [System.InvalidCastException] {"Invalid cast from 'System.String' to 'System.Guid'."} with the following StackTrace StackTrace " at System.Convert.DefaultToType(IConvertible value, Type targetType, IFormatProvider provider)\r\n at System.String.System.IConvertible.ToType(Type type, IFormatProvider provider)\r\n at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)\r\n at Mindscape.LightSpeed.Web.DynamicData.LightSpeedLinqDataSourceView.SetPropertyValue(Entity entity, DictionaryEntry nameValuePair)\r\n at Mindscape.LightSpeed.Web.DynamicData.LightSpeedLinqDataSourceView.<>c__DisplayClass4.<ExecuteInsert>b__3(IUnitOfWork u, Type entityType)\r\n at Mindscape.LightSpeed.Web.DynamicData.LightSpeedLinqDataSourceView.Execute(DataSourceOperation operation, Action`2 action)\r\n at Mindscape.LightSpeed.Web.DynamicData.LightSpeedLinqDataSourceView.ExecuteInsert(IDictionary values)\r\n at System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback)" string
I followed the instructions on wiring up a dynamic data website to use Lightspeed, is there something additional I need to do to support the use of Guid identities? Thanks, Mark
|
|
|
Hi Mark, This appears to be a bug in our dynamic data implementation. I have committed a fix and it will be available in nightly builds dated 27 Feb 2009 and above, available from about 1430 GMT. |
|
|
Thanks for addressing this issue. Unfortunately I am now encountering another couple of problems. One of my entities has a nullable foreign key relationship (again using GUIDs) with another entity. The first issue I encounter when I try to insert a new entity, is that the dropdown list for the nullable foreign key column does not provide a [Not Set]/emtpy option, hence I always have to set the foreign key. When I step through the code-behind for the default foreign key field template indicates that the column is required. The second issue occurs when I try and save the new record, an exception is thrown by what appears to be the attempt to save the nullable foreign key. The following is the stacktrace. Invalid cast from 'System.String' to 'System.Nullable`1[[System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'. at System.Convert.DefaultToType(IConvertible value, Type targetType, IFormatProvider provider) |
|
|
Hello Mark, I have committed fixes for these issues and they will be included in nightly builds dates 3 Mar 2009 and above. |
|