I have a Kendo UI Grid which uses the Serial
class as its model. This class has relation with the row
class, but I don't use any of the navigation properties in my Grid and I don't need them in this particular page.
The problem is, Kendo UI populates all of the foreign key relations. So the row
class and all of the navigation properties of itself will be populated. When I try to save my edit, Kendo posts all of these data and this causes ModelState.IsValid
always be false
. Do you have any suggestion?
This is the Serial
class, and I have a field for each property.
public class Serial
{
[Key]
[Column(TypeName = "BIGINT", Order = 0)]
public Int64 LiIdR { get; set; }
[ForeignKey("LiIdR")]
public virtual Rows Row { get; set; }
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Int16 SRadifS { get; set; }
public string AFromSerial { get; set; }
public string AToSerial { get; set; }
public int? IQnty { get; set; }
public string AExpireDate { get; set; }
public string AComment { get; set; }
}