How can I implement complex database structure
There is a sample in the Developers Guide which shows the creation of a "product" module. This module stores information about products in the Sitefinity database using data persisting class. But I need to store information about a couple of object of different classes with relations or at least foreign keys. How can i do that?
Hi Mikhail,
We had this issue aswell, we had a locations module to build that needed to store features for a location. I am not sure if this has changed, as typically you would look to link objects, but the way we were told to do it was via a tracked list of GUIDs, so in out LocationItem object we had:
private TrackedList<
Guid
> services;
[FieldAlias("services")]
[DataMember]
[ReadOnly(true)]
public IList<
Guid
> Services
get
if(this.services == null)
this.services = new TrackedList<
Guid
>();
return this.services;
set
var pc = this.Services;
pc.Clear();
foreach(var id in value)
pc.Add(id);
locationMapping.HasAssociation(p => p.Services);
thats all i could see, and it has been a while so i dont think there is anything else.
Hope that helps a bit.
Rob