I would like to save (and eventually view data) from a view in asp.net mvc application using entity framework. The model is as follows:
public class Class
{
public Class()
{
this.params1= new HashSet<Param1>();
this.params2= new HashSet<Param2>();
}
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long Id { get; set; }
public long param3{ get; set; }
public long param4{ get; set; }
public virtual ICollection<Param1> params1 { get; set; }
public virtual ICollection<Param2> params2{ get; set; }
}
The display of data in the view is made in a way that it is included in different sections ( params1 are displayed in a grid while params2 are displayed in forms). I'm not quite sure whether I should pick the data with javascript code and then send it to the controller to save data or if I can achieve this with html helpers to directly go from the cshtml file to the controller file.