This project is read-only.

Orchard Data access

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

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 ?
Sep 5, 2013 at 9:44 AM
Edited Sep 5, 2013 at 9:45 AM
Have you taken a look at the docs?

Also take a look at the relationships between Permissions and Roles. That should show you what to do.
Sep 5, 2013 at 10: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 ?
Sep 5, 2013 at 10:21 AM
Have you looked at Permissions and Roles? neither of those inherit from ContentPart or ContentPartRecord.
Sep 5, 2013 at 10: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 ?
Sep 6, 2013 at 1:28 AM
Also, the members you want persisted will have to be virtual.