DDS Identity problem

Vote:
 

Hi all!

I have a class that I am going to add to DDS:

public class GroupEpi
{

public Identity Id { get; set; }

public OrgExtended Group { get; set; }

}

Identity field is added to to do manipulations with items in DDS object.

Problem is that OrgExtended object also has Id field. When I try to save object to DataStore, I get error:

Property Id must be of type System.Guid or EPiServer.Data.Identity

I cant change OrgExtended object, because its imported from WebService.

Help please!

#120359
Apr 15, 2015 16:24
Vote:
 

Hi Olga,

As a quick workaround, can you serialize OrgExtended to json and store it as a string in DDS?

#120363
Apr 15, 2015 17:18
Vote:
 

Can you also post a definition of OrgExtended class? If OrgExtended is not too complex, perhaps there are better workarounds than JSON.

Do you only need to create / fecth objects by id, or do you want to execute Linq queries as well?

#120375
Apr 15, 2015 22:43
Vote:
 

You could try to add the [EPiServerIgnoreDataMember] attribute to OrgExtended.Id but the property name Id might be a special case where it does not work. Another way could be not using the OrgExtended class on your DDS object, but instead use a model class and convert between the two. But I kind of sense that what you would really want is to only store a reference to the OrgExtended (its ID) since the ID indicates it is stored by some other system?

#120395
Apr 16, 2015 8:20
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.