【发布时间】:2015-12-09 00:28:17
【问题描述】:
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 在视图中创建了我的艺术品选项。现在我的问题是如何发布(操作方法)这些数据以便我可以插入到 GraphicArtwork 表中。
【问题讨论】:
标签: entity-framework asp.net-mvc-4 knockout.js