Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Although I am not clear about the aim of your question, you can do things like this:</p> <h2>One-to-many relationship</h2> <p>A company can have only one country of origin. But a country can have many companies.</p> <pre><code>public class Country { public int ID{get; set;} public string CountryName{get; set;} public List&lt;Company&gt; Items{get; set;} public int SaveOrUpdate(){} public static Country Get(int id){} public static List&lt;Country&gt; Get(){} public bool Delete(){} } public class Company { public int ID {get; set;} public string CompanyName{get; set;} public int CountryID{get; set;} public Country Country{get; set;} public int SaveOrUpdate() {} public static Company Get(int id) {} public static List&lt;Company&gt; Get(){} public bool Delete() {} } </code></pre> <h2>Master-Detail relationship</h2> <pre><code>public class Order { public int ID {get;set;} public DateTime OrderDate {get;set;} public List&lt;OrderDetail&gt; Items {get;set;} public int SaveOrUpdate(){} public static Order Get(int id){} public static List&lt;Order&gt; Get(){} public bool Delete(){} } public class OrderDetail { public int OrderID{get;set;} public string ProductName{get;set;} public double Price{get;set;}{get;set;} public Order Order {get;} public static void Save(TransactionContext tc, int masterID, List&lt;OrderDetail&gt; items){} public static void Delete(TransactionContext tc, int masterID){} public static List&lt;OrderDetail&gt; Get(TransactionContext tc, int masterID){} } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload