Replies: 2 comments 13 replies
-
I know it is possible. I never had to use this method because I generally use CreateMapIndexTable in my Migrations.cs file create method. I would need to dig in the issues to remember how to achieve this. Though, you can use CreateForeignKey method to create the relationship between those tables. After that, I would need to see how you can use YesSQL to insert data in those tables. |
Beta Was this translation helpful? Give feedback.
-
Keep your document comprehensive as much as possible. If you need to store related documents as reference then store their reference key (id) in document You can use MapIndex to optimize your queries as @Skrypt suggests However Each referenced documents require to be loaded via separate query |
Beta Was this translation helpful? Give feedback.
-
I am very new to Orchard Core and Document database. I am using Orchard Core in Decoupled mode and I am using the concept from saving the Todo items from OchardCore.Demo (where a Content Type is not defined). How do I use YesSql.ISession to get the related documents? Let me explain what I am trying to do: I have 2 models, Issue and Issue Type, which are created without a Content Type definitions. Here are my models for Issue and IssueType:
public class Issue
{
public string IssueId { get; set; }
public string Subject { get; set; }
public DateTime Created { get; set; }
public String Description { get; set; }
public string IssueTypeId { get; set; }
... //other properties
}
public class IssueType
{
public string TypeId { get; set; }
public string Name { get; set; }
public string Description { get; set; }
...//other properties
}
The property IssueTypeId in Issue model class references the TypeId in IssueType class. I have the need for IssueType to be independently accessible rather than embedding it. So, my questions is when I am getting the list of Issues, how do I get the corresponding IssueType for each issue in the list? Is there something similar to EntityFramework's Include method, which loads related data?
Beta Was this translation helpful? Give feedback.
All reactions