This project has moved and is read-only. For the latest updates, please go here.

Type not supported

Feb 3, 2009 at 7:29 PM
Unable to create code for an entity having the following element:
public System.Collections.ObjectModel.Collection<DateTime> OfficeHolidays { set; get; }

Please help!
Feb 4, 2009 at 11:38 AM
Someone else had a similar problem recently and I have just posted a bug fix which should resolve this problem. The interim release is here:
Feb 4, 2009 at 5:06 PM
Thanks for the interim release but still the derived classes issue seems not fixed as I get the error: Expected object of type system.object, but was of system.int32.
I fixed this error with a workaround as you suggested in one of your discussions for derived types. I had to manually cast my derived object in the generated code after this, but the good part was that I was able to generate the script.

It would be helpful if you can post the code for this interim release and I can move forward or advise!
Thanks again & appreciate your swift attention to this matter.

Feb 4, 2009 at 9:20 PM
This one really should be fixed, but I don't want to post source yet as it would take me a bit of time to put it together and the code is not really in a state in which I would want to publish it. Can you post a repro? Use the contact feature on the People page to contact me and we can exchange emails on the repro.
Feb 6, 2009 at 8:27 AM
I have posted a new interim release which I think will fix this issue here:
Feb 6, 2009 at 4:19 PM
Thanks Robert, this release now addresses the issue of derived types but still an important aspect of downcasting is left...


Class CustomerIndividualBE derives from class CustomerBE

Attribute in CustomerBE- FullName
Attribute in CustomerIndividualBE - Phone

CustomerBE  customer  = new Server.DataEntities.Customer.CustomerIndividualBE();      // GENERATED OK BY THE WCF LOAD TOOL
customer.FullName = "ROBJARRATT";                                                                                         // GENERATED OK BY THE WCF LOAD TOOL
customer.Phone = "1234567890";                                                                                                  // ERROR HERE, UNABLE TO DOWNCAST AS EXPLICIT CAST IS MISSING...

Code should be generated as:
((CustomerIndividualBE)customer).Phone = "1234567890";   
Feb 8, 2009 at 8:54 AM
I have checked the code and scenarios like this should already work correctly. There must be a scenario that I have missed. In that case it would help me if you could send me a repro. Could you repro this bug with the command line tool and then send me the trace file, config file and assemblies required in an attached zip (I think the max attachment size is 5MB). You should already have my email address from our earlier discussion, if not contact me via the people tab and I will reply again with my email address.