RavenDB文档展示了如何使用Includes来处理此sample中的文档关系。
public class Order
{
public Product[] Items { get; set; }
public string CustomerId { get; set; }
public double TotalPrice { get; set; }
}
public class Product
{
public string Id { get; set; }
public string Name { get; set; }
public string[] Images { get; set; }
public double Price { get; set; }
}
public class Customer
{
public string Name { get; set; }
public string Address { get; set; }
public short Age { get; set; }
public string HashedPassword { get; set; }
}
如果我不想使用包含/实时预测包含客户,而是使用产品列表,我将如何处理包含或实时预测:
public class Order
{
public string[] ItemIds { get; set; }
public string CustomerId { get; set; }
public double TotalPrice { get; set; }
}
答案 0 :(得分:1)
如果我理解你的要求,这应该会有所帮助。我在这里写了博客:
http://inaspiralarray.blogspot.com/2012/03/keeping-domain-model-pure-with-ravendb.html
这有帮助吗?