开发者

How to autogenerate navigation included entities?

开发者 https://www.devze.com 2023-03-10 11:29 出处:网络
I have a dataform that is bound to a list of objects.The fields on the dataform are generated for the primitive properties (name, description, etc).Howe开发者_开发百科ver, this object also includes a

I have a dataform that is bound to a list of objects. The fields on the dataform are generated for the primitive properties (name, description, etc). Howe开发者_开发百科ver, this object also includes a complex object that has its own properties. How do I tell the dataform to autogenerate the primitive properties for this as well?

public class Order
{
  public int OrderId {get; set;}
  public string Name {get; set;}
  public OrderDetail OrderDetails {get; set;}
}

public class OrderDetail
{
   public int OrderDetailId {get; set;}
   public int OrderId {get; set;}
   public double Cost {get; set;}
}


I don't believe this has anything to do with Entity Framework, this is a pure DataForm issue.

If you look around online, seems like DataForms don't render complex properties by default. You need to change the view template to tell it what to do.

See https://stackoverflow.com/questions/3867146/can-or-should-dataforms-be-nested

0

精彩评论

暂无评论...
验证码 换一张
取 消