I have a table called Field in my database and a table called FieldValue. My models look like this:
[Table("Field")]
public class Field
{
[Key]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
public int FieldId { get; set; }
public string Value { get; set; }
}
[Table("FieldValue")]
public class FieldValue
{
[Key]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
public int FieldValueId { get; set; }
public int FieldId { get; set; }
public string Value { get; set; }
}
I would like to display each field as the label and then a textbox for each FieldValue associated with that Field but I'm not quite sure how to approach this. I am using MVC 4 if that matters.