Orchard Data access

Topics: Core, Customizing Orchard, General
Sep 5, 2013 at 8:16 AM
Hello,

Orchard data access layer is not clear for me.
I have two entities like this
public class A
{
   public int Id { get; set;}
}

public class B
{
    public int Id { get; set;}
    public IList<A> List { get; set; }
}
My question is how to describe correctly mapping that in the end I will be able to get entity B with filled List field.
How can I achieve that ?
Developer
Sep 5, 2013 at 8:44 AM
Edited Sep 5, 2013 at 8:45 AM
Have you taken a look at the docs? http://docs.orchardproject.net/Documentation/Understanding-data-access

Also take a look at the relationships between Permissions and Roles. That should show you what to do.
Sep 5, 2013 at 9:14 AM
Yes, but it's related with content.
I have a few entities which are not content and I want to store it into db without inheriting from ContentPart or ContentPartRecord.
What about this case ? How specify relathionship between entities ?
Developer
Sep 5, 2013 at 9:21 AM
Have you looked at Permissions and Roles? neither of those inherit from ContentPart or ContentPartRecord.
Sep 5, 2013 at 9:41 AM
Yes, I have. Ok I'll try, thanks!
But I also noticed that there are no foreign keys in tables. Is it ok ?
Coordinator
Sep 6, 2013 at 12:28 AM
Also, the members you want persisted will have to be virtual.