如何将一些<t>数据集合发布到MVC动作?

时间:2015-09-12 15:25:30

标签: entity-framework asp.net-mvc-4 knockout.js

public class Graphic
{
    ...
    ...
    [ScaffoldColumn(false)]
    public int GraphicId { get; set; }
    public virtual ICollection<GraphicArtwork> GraphicArtworks { get; set; }
}

public class GraphicArtwork
{
    [Key]
    public int GraphicArtworkId { get; set; }
    public int GraphisId { get; set; }
    [Required(ErrorMessage = "The {0} is required.")]
    [StringLength(500)]
    public string ArtOptionText { get; set; }
    public decimal Price { get; set; }
    [DisplayName("Active")]
    public bool IsActive { get; set; }
    public DateTime CreatedDate { get; set; }
    [NotMapped]
    public int TotalRecordCount { get; set; }
}

我有这两个表和模型。在这里,我有一个图形与许多艺术作品选项。我使用Knockout.js在视图中创建了我的艺术作品选项。现在我的问题是如何发布(Action方法)这些数据,以便我可以插入到GraphicArtwork表中。

enter image description here

1 个答案:

答案 0 :(得分:1)

draw()